Skip to content
Snippets Groups Projects
Commit 409e7355 authored by Piers Williams's avatar Piers Williams
Browse files

Removed unneeded action and moved orders into own package

parent 50889d6d
No related branches found
No related tags found
No related merge requests found
package com.fossgalaxy.games.ggj2017;
import com.fossgalaxy.games.ggj2017.drones.DroneBuildAction;
import com.fossgalaxy.games.tbs.GameState;
import com.fossgalaxy.games.tbs.entity.Entity;
import com.fossgalaxy.games.tbs.entity.EntityType;
import com.fossgalaxy.games.tbs.entity.Resource;
import com.fossgalaxy.games.tbs.entity.ResourceType;
import com.fossgalaxy.object.annotations.ObjectDef;
import org.codetome.hexameter.core.api.CubeCoordinate;
public class BuildOnResourceAction extends DroneBuildAction {
private ResourceType typeOn;
// Can build type only on places containing typeOn
@ObjectDef("BuildOnResource")
public BuildOnResourceAction(EntityType type, ResourceType typeOn) {
super(type);
this.typeOn = typeOn;
}
@Override
public boolean isPossible(Entity entity, GameState s, CubeCoordinate co) {
if (!super.isPossible(entity, s, co)) return false;
// Check resource of correct type is present
Resource resourceAt = s.getResourceAt(co);
if (resourceAt == null) {
return false;
}
return (resourceAt.getType().equals(typeOn));
}
}
package com.fossgalaxy.games.ggj2017.drones;
import com.fossgalaxy.games.ggj2017.BuildOnResourceAction;
import com.fossgalaxy.games.tbs.GameState;
import com.fossgalaxy.games.tbs.actions.BuildOnResourceAction;
import com.fossgalaxy.games.tbs.entity.Entity;
import com.fossgalaxy.games.tbs.entity.EntityType;
import com.fossgalaxy.games.tbs.entity.ResourceType;
......
package com.fossgalaxy.games.ggj2017;
package com.fossgalaxy.games.ggj2017.orders;
import com.fossgalaxy.games.tbs.GameState;
......
package com.fossgalaxy.games.ggj2017;
package com.fossgalaxy.games.ggj2017.orders;
import com.fossgalaxy.games.tbs.GameState;
......
......@@ -65,7 +65,8 @@
"name": "gold_mine",
"_extends":"abstract_mine",
"sprite":{
"image":"resources/scifi_tower.png"
"image":"resources/scifi_tower",
"scale": 0.5
},
"costs":{
"metal":150
......@@ -78,7 +79,8 @@
"name": "metal_mine",
"_extends":"abstract_mine",
"sprite":{
"image":"resources/scifi_tower.png"
"image":"resources/scifi_tower",
"scale": 0.5
},
"costs":{
"gold":100
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment