public void TryExplodePlate(FastFoodMissile missile, FastFoodUserPlate target) { this.Missiles.Remove(missile); if (target.TryExplodePlate()) { this.RemovePlate(target); } }
public bool LaunchMissile(int gameUserId) { FastFoodUserPlate plate = this.Plates.Where(p => p.User?.GameUserID != gameUserId).OrderBy(p => p.Distance).FirstOrDefault(); if (plate != null) { this.SendToAll(new LaunchMissileOutgoingPacket(plate.User.GameUserID, plate.Plate.ID, gameUserId)); this.Missiles.Add(new FastFoodMissile(this, plate)); return(true); } else { return(false); } }
public FastFoodUserPlate ReleaseFood(FastFoodGameUser fastFoodGameUser) { if (this.Status == GameStatus.Running) { fastFoodGameUser.PlateTimer?.Stop(); FastFoodUserPlate plate = new FastFoodUserPlate(this, fastFoodGameUser, FastFoodGamePlate.Plates[fastFoodGameUser.NextPlateId], (fastFoodGameUser.PlateTimer?.Elapsed.TotalMilliseconds) < (FastFoodGamePlate.Plates[fastFoodGameUser.NextPlateId].PlateTimer / 60d) * 1000d); this.Plates.Add(plate); return(plate); } else { return(null); } }
public void RemovePlate(FastFoodUserPlate fastFoodUserPlate) { this.Plates.Remove(fastFoodUserPlate); }