// disables cannon usability if another cannon kills the controling units static void DeactivateCannonByCannon(Player p) { foreach (Cannon c in p.Can) { if (c.Manned && !c.Moved) { CannonMaster.SetCannon(c); } } }
// enable cannon is a legal conditions met when a unit moves near it static void ActivateCannonByMove(Player p) { foreach (Cannon c in p.Can) { if (!c.manned) { CannonMaster.SetCannon(c); } } }
public void ResetMovable() { foreach (Unit u in Inf) { u.Moved = false; } foreach (Unit u in Cav) { u.Moved = false; } foreach (Cannon c in Can) { CannonMaster.SetCannon(c); } }