Ejemplo n.º 1
0
        public void TryExplodePlate(FastFoodMissile missile, FastFoodUserPlate target)
        {
            this.Missiles.Remove(missile);

            if (target.TryExplodePlate())
            {
                this.RemovePlate(target);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
 public void RemovePlate(FastFoodUserPlate fastFoodUserPlate)
 {
     this.Plates.Remove(fastFoodUserPlate);
 }