public FastFoodUserPlate(GameLobby game, FastFoodGameUser user, FastFoodGamePlate plate, bool failed)
        {
            this.GameLobby = game;
            this.User      = user;
            this.Plate     = plate;
            this.Failed    = failed;

            this.Speed    = 0;
            this.Distance = 1;

            this.UpdateState(GamePlateState.Falling);
        }
Exemple #2
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);
            }
        }