public override void Update(CosmicUnit unit) { Position = unit.Position; MoveVector = unit.MoveVector; Radius = unit.Radius; }
public virtual void Update(CosmicUnit unit) { Position = unit.Position; MoveVector = unit.MoveVector; Radius = unit.Radius; Team = unit.Team; }
public override void Update(CosmicUnit unit) { base.Update(unit); }
public CosmicMap(List <Unit> scannedUnits, Ship scanningShip) { namedUnits = new Dictionary <string, CosmicUnit>(); foreach (Unit scannedUnit in scannedUnits) { if (scannedUnit.Mobility != Mobility.Still) { movement = -scannedUnit.Movement; break; } } if (movement == null) { movement = new Vector(); } foreach (Unit scannedUnit in scannedUnits) { CosmicUnit cosmicUnit = CosmicUnit.FromFVUnit(scannedUnit); if (cosmicUnit.Still) { ScanningShipMovement = -scannedUnit.Movement; } if (cosmicUnit.Still) { cosmicUnit.MoveVector = new Vector(); } else { cosmicUnit.MoveVector += ScanningShipMovement; } if (cosmicUnit.Still) { stillUnits.Add(cosmicUnit); } else { mobileUnits.Add(cosmicUnit); } if (cosmicUnit.Gravity != 0) { gravitalUnits.Add(cosmicUnit); } if (cosmicUnit is CosmicExplosion) { namedUnits.Add("e-" + scannedUnit.Name, cosmicUnit); } else { namedUnits.Add(scannedUnit.Name, cosmicUnit); } if (cosmicUnit is CosmicShot || cosmicUnit is CosmicExplosion) { shotUnits.Add(cosmicUnit); } if (cosmicUnit is CosmicShip) { shipUnits.Add(cosmicUnit); mobileUnits.Add(cosmicUnit); } } CosmicOwnership ownShip = new CosmicOwnership(scanningShip); ownShip.MoveVector = ScanningShipMovement; namedUnits.Add(ownShip.Name, ownShip); if (ownShip.Still) { stillUnits.Add(ownShip); } else { mobileUnits.Add(ownShip); } shipUnits.Add(ownShip); }
public bool TryGetValue(string name, out CosmicUnit unit) { lock (sync) return(namedUnits.TryGetValue(name, out unit)); }
public override void Update(CosmicUnit unit) { DominationTicks = ((CosmicMissionTarget)unit).DominationTicks; Color = ((CosmicMissionTarget)unit).Team.Color; }