public ReturnCargoCommand(Unit unit, Structure targetStructure, Resource source) : base(unit, targetStructure.CenterPoint) { TargetStructure = targetStructure; Source = source; }
public HarvestCommand(Unit unit, Resource targetResource) : base(unit, targetResource.CenterPoint) { TargetResource = targetResource; }
public static void RemoveResource(Resource r) { Resources.Remove(r); Roks roks = r as Roks; if (roks != null) Roks.AllRoks.Remove(roks); }
bool harvest(Resource resource) { Roks roks = resource as Roks; if (roks != null) { if (roks.CheckForEntrance(this)) { Targetable = false; Busy = true; Unit.RemoveUnit(this); return true; } } return false; }
public void ReturnCargoToNearestTownHall(Resource source) { if (CargoAmount == 0) return; TownHall nearestTownHall = FindNearestTownHall(); if (nearestTownHall != null) { //if (Commands.Count == 0 || !(Commands[0] is HarvestCommand)) //{ // Resource nearestResource = findNearestResource(CargoType); // if (nearestResource != null) // InsertCommand(new HarvestCommand(nearestResource, 1)); //} stop(); InsertCommand(new ReturnCargoCommand(this, nearestTownHall, source)); } }
public RallyPoint(Vector2 point, Resource resource) { Point = point; Resource = resource; }