Add code, gitignore, commit script

main
Brett 2023-03-01 13:23:35 -05:00
parent 81a8f8ae04
commit b3c14a0611
32 changed files with 408 additions and 11 deletions

0
.gitignore vendored Normal file
View File

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -0,0 +1,25 @@
package ca.cosc3p91.a2.game;
import ca.cosc3p91.a2.player.Player;
public class GameEngine {
private Player player;
private int pillageFactor;
private int currentTime;
public Map map;
public void attackVIllage(Map map) {
}
public Map generateMap() {
return null;
}
public void getScore(Map map) {
}
}

View File

@ -0,0 +1,35 @@
package ca.cosc3p91.a2.game;
import ca.cosc3p91.a2.gameobjects.*;
import java.util.List;
public class Map {
private Village_Hall townHall;
private int guardTime;
private List<Building> contains;
public List<Inhabitant> inhabitants;
public void move(Infantry i, Tile t) {
}
public void inRange(Infantry i, Building b) {
}
public void build(Village_Hall hall, Tile t, Building b) {
}
public int getGuardTime() {
return guardTime;
}
public void setGuardTime() {
}
}

View File

@ -0,0 +1,4 @@
package ca.cosc3p91.a2.gameobjects;
public class Archer extends Infantry {
}

View File

@ -0,0 +1,4 @@
package ca.cosc3p91.a2.gameobjects;
public class ArcherTower extends DefenseBuilding {
}

View File

@ -0,0 +1,50 @@
package ca.cosc3p91.a2.gameobjects;
import java.util.List;
public abstract class Building {
private static int level;
private int health;
private static Stage stages;
private int goldCost;
private int ironCost;
private int woodCost;
private int buildTime;
public List<Stage> stage;
public Tile tile;
public List<Inhabitant> inhabitant;
public int getLevel() {
return level;
}
public int getHealth() {
return health;
}
public int getCost(String type) {
return 0;
}
public int getUpgradeCost() {
return 0;
}
public void upgrade() {
}
public int getBuildTime() {
return 0;
}
}

View File

@ -0,0 +1,4 @@
package ca.cosc3p91.a2.gameobjects;
public class Cannon extends DefenseBuilding {
}

View File

@ -0,0 +1,4 @@
package ca.cosc3p91.a2.gameobjects;
public class Catapult extends Infantry {
}

View File

@ -0,0 +1,11 @@
package ca.cosc3p91.a2.gameobjects;
public class Collector {
private int averageCollectionRate;
public int getCollectionRate() {
return averageCollectionRate;
}
}

View File

@ -0,0 +1,13 @@
package ca.cosc3p91.a2.gameobjects;
public class DefenseBuilding extends Building {
public int damage;
public int range;
public void attack(Infantry attacker) {
}
}

View File

@ -0,0 +1,15 @@
package ca.cosc3p91.a2.gameobjects;
class DefenseStage extends Stage {
protected int dDamge;
protected int dRange;
public void getDamageChange() {
}
public void getRangeChange() {
}
}

View File

@ -0,0 +1,13 @@
package ca.cosc3p91.a2.gameobjects;
public class Farm extends ResourceBuidling {
public int getPopulationContribution() {
return 0;
}
@Override
public void harvest(Village_Hall hall) {
}
}

View File

@ -0,0 +1,11 @@
package ca.cosc3p91.a2.gameobjects;
public class GoldMine extends ResourceBuidling {
public static String resource = "good";
@Override
public void harvest(Village_Hall hall) {
}
}

View File

@ -0,0 +1,23 @@
package ca.cosc3p91.a2.gameobjects;
public abstract class Infantry {
private int health;
private int damage;
private int range;
public void attack(Building b) {
}
public void getHealth() {
}
public void getDamage() {
}
public void getRange() {
}
}

View File

@ -0,0 +1,14 @@
package ca.cosc3p91.a2.gameobjects;
import ca.cosc3p91.a2.game.Map;
public interface Inhabitant {
public Map map = null;
public Building building = null;
public void move(Tile t);
public void getPosition();
}

View File

@ -0,0 +1,11 @@
package ca.cosc3p91.a2.gameobjects;
public class IronMine extends ResourceBuidling {
public static String resource = "iron";
@Override
public void harvest(Village_Hall hall) {
}
}

View File

@ -0,0 +1,4 @@
package ca.cosc3p91.a2.gameobjects;
public class Knight extends Infantry {
}

View File

@ -0,0 +1,11 @@
package ca.cosc3p91.a2.gameobjects;
public class LumberMine extends ResourceBuidling {
public static String resource = "wood";
public void harvest(Village_Hall hall) {
}
}

View File

@ -0,0 +1,11 @@
package ca.cosc3p91.a2.gameobjects;
public abstract class ResourceBuidling extends Building {
public static String resource;
private int harvest_rate;
public abstract void harvest(Village_Hall hall);
}

View File

@ -0,0 +1,11 @@
package ca.cosc3p91.a2.gameobjects;
public class ResourceStage extends Stage {
protected int harvestRateIncrease;
public int getHarvestRateIncrease() {
return harvestRateIncrease;
}
}

View File

@ -0,0 +1,4 @@
package ca.cosc3p91.a2.gameobjects;
public class Soldier extends Infantry {
}

View File

@ -0,0 +1,34 @@
package ca.cosc3p91.a2.gameobjects;
abstract class Stage {
protected int dHealth;
protected int goldCost;
protected int requiredVillageLevel;
protected int upgradeTime;
protected int ironCost;
protected int woodCost;
public Building building;
public void getHealthChange() {
}
public int getCost(String type) {
return 0;
}
public int getRequiredVillageLevel() {
return requiredVillageLevel;
}
public int getUpgradeTime() {
return upgradeTime;
}
}

View File

@ -0,0 +1,13 @@
package ca.cosc3p91.a2.gameobjects;
import java.util.List;
public class Tile {
public int x;
public int y;
public List<Building> building;
}

View File

@ -0,0 +1,23 @@
package ca.cosc3p91.a2.gameobjects;
class VillageStage extends Stage {
protected int goldCapacityIncrease;
protected int ironCapacityIncrease;
protected int woodCapacityIncrease;
public int getGoldCapacityIncrease() {
return goldCapacityIncrease;
}
public int getIronCapacityIncrease() {
return ironCapacityIncrease;
}
public int getWoodCapacityIncrease() {
return woodCapacityIncrease;
}
}

View File

@ -0,0 +1,23 @@
package ca.cosc3p91.a2.gameobjects;
public class Village_Hall extends Building {
private int goldCapacity;
private int ironCapacity;
private int woodCapacity;
public int getGoldCapacity() {
return goldCapacity;
}
public int getIronCapacity() {
return ironCapacity;
}
public int getWoodCapacity() {
return woodCapacity;
}
}

View File

@ -0,0 +1,11 @@
package ca.cosc3p91.a2.gameobjects;
public class Worker {
private boolean currentlyBuilding;
public boolean isCurrentlyBuilding() {
return currentlyBuilding;
}
}

View File

@ -0,0 +1,11 @@
package ca.cosc3p91.a2.player;
public class Player {
public int currentGold;
public int currentIron;
public int currentWood;
}

View File

@ -0,0 +1,4 @@
package ca.cosc3p91.a2.userinterface;
public class GuiManager {
}

3
commit.sh Executable file
View File

@ -0,0 +1,3 @@
git add *
git commit
git push -u origin main

View File

@ -1,8 +0,0 @@
package ca.cosc3p91.a2.game;
public class Main {
public static void main(String[] args) {
System.out.println("Hog Ridah!");// write your code here
}
}

View File

@ -3,10 +3,9 @@
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Assignment 2/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
</module>