public Building(BuildingType t, Sector s, DateTime d) { this.type = t; this.sector = s; this.date = d; this.hitpoints = Info.Hitpoints; this.number = 1; this.UpgradingFrom = BuildingType.None; Sector.Buildings.Add(this); if (Sector.Owner != null) Sector.Owner.Buildings.Add(this); }
public override void Create(Sector s) { if (!s.Units.Contains(this)) s.Units.Add(this); if (Owner != null) Owner.Units.Add(this); }
public Unit(UnitType t, Sector s, Player p, DateTime d) { this.type = t; this.sector = s; this.owner = p; this.date = d; this.action = UnitAction.None; this.hitpoints = Info.Hitpoints; this.number = 1; Sector.Units.Add(this); if (Owner != null) Owner.Units.Add(this); }
public override void Create(Sector s) { if (!s.Buildings.Contains(this)) s.Buildings.Add(this); if (s.Owner != null) s.Owner.Buildings.Add(this); }
public bool HasView(Sector s) { if (IsAlly(s.Owner)) return true; foreach (Unit u in s.Units) if ((u.IsAvailable || u.IsWorking) && IsAlly(u.Owner)) return true; return false; }
public abstract void Create(Sector s);