private void placeHeldIngredientOnBoard()
 {
     if (Client.gameState.Equals(ClientGameState.MainMode)) /* Main mode */
     {
         if (Player.isHoldingIngredient())                  /* Main mode */
         {
             if (ingredientToChop == null)
             {
                 SetIngredientToChop(Player.currentIngred);
                 Player.removeCurrentIngredient();
             }
             else
             {
                 Debug.Log("Already an item on the chopping board");
             }
         }
         else
         {
             Debug.Log("No held item to add to board");
         }
     }
     else             /* Tutorial mode */
     {
         if (SimulatedPlayer.isHoldingIngredient())
         {
             if (ingredientToChop == null)
             {
                 SetIngredientToChop(SimulatedPlayer.currentIngred);
                 SimulatedPlayer.ingredientInChopping = SimulatedPlayer.currentIngred;
                 SimulatedPlayer.removeCurrentIngredient();
                 tapAnimation.SetActive(ingredientToChop == null);
                 infoPanel.SetActive(ingredientToChop != null);
                 fadeBackground.SetActive(ingredientToChop != null);
             }
             else
             {
                 Debug.Log("Already an item on the chopping board");
             }
         }
         else
         {
             Debug.Log("No held item to add to board");
         }
     }
 }
Beispiel #2
0
    public void placeHeldIngredientInPan()
    {
        /* Add ingredient */
        if (Player.isHoldingIngredient())           /* Main mode */
        {
            if (panContents.Count < maxPanContents)
            {
                addIngredientToPan(Player.currentIngred);

                /* Notify server that player has placed ingredient */
                player.notifyServerAboutIngredientPlaced(Player.currentIngred);

                Player.removeCurrentIngredient();
            }
            else
            {
                test_text.text      = "Pan is full";
                background.material = issueMaterial;
            }
        }
        else if (SimulatedPlayer.isHoldingIngredient())             /* Tutorial mode */
        {
            if (panContents.Count < maxPanContents)
            {
                tapAnimation.SetActive(false);
                infoPanel.SetActive(true);
                fadeBackground.SetActive(true);
                addIngredientToPan(SimulatedPlayer.currentIngred);
                SimulatedPlayer.ingredientsInFrying.Add(SimulatedPlayer.currentIngred);
                SimulatedPlayer.removeCurrentIngredient();
            }
            else
            {
                test_text.text      = "Pan is full";
                background.material = issueMaterial;
            }
        }
        else
        {
            /* TODO: What happens when player is not holding an ingredient */
            test_text.text = "No held ingredient";
        }
    }
Beispiel #3
0
    public void placeHeldIngredientInPlate()
    {
        /* Add ingredient */
        if (Player.isHoldingIngredient())
        {
            if (plateContents.Count < maxPlateContents)
            {
                addIngredientToPlate(Player.currentIngred);

                /* Notify server that player has placed ingredient */
                player.notifyServerAboutIngredientPlaced(Player.currentIngred);

                Player.removeCurrentIngredient();
            }
            else
            {
                /* TODO: What happens plate is full */
            }
        }
        else if (SimulatedPlayer.isHoldingIngredient())
        {
            if (plateContents.Count < maxPlateContents)
            {
                tapImage.SetActive(false);
                addIngredientToPlate(SimulatedPlayer.currentIngred);

                /* Notify server that player has placed ingredient */
                SimulatedPlayer.ingredientsInPlating.Add(SimulatedPlayer.currentIngred);
                SimulatedPlayer.removeCurrentIngredient();

                /* Instruct the player to serve the food */
                InstructToServe();
            }
            else
            {
                /* TODO: What happens plate is full */
            }
        }
        else
        {
            /* TODO: What happens when player is not holding an ingredient */
        }
    }
Beispiel #4
0
        private void CreatePlayerList(Int32 players, Int32 rounds, Int32 stopScore, Decimal betAmount, Boolean sameScore)
        {
            Int32 currentStopScore = stopScore;

            for (int i = 0; i < players; i++)
            {
                String inputName = "Player " + i;
                if (sameScore)
                {
                    currentStopScore = stopScore;
                }
                else
                {
                    currentStopScore = stopScore + i;
                }
                SimulatedPlayer player = new SimulatedPlayer(inputName, currentStopScore);
                player.CurrentMoney = (player.CurrentMoney * rounds);
                player.CurrentBet   = betAmount;
                String currentMoneyInDollars = player.CurrentMoney.ToString("C", new CultureInfo("en-US"));
                Console.WriteLine("{0} starts with {1}.", player.UserName, currentMoneyInDollars);
                TotalPlayerCollection.List.Add(player);
            }
        }
Beispiel #5
0
 public void viewItems()
 {
     /* If the current item is null, instantiate it when viewing */
     if (Client.gameState.Equals(ClientGameState.MainMode))
     {
         if (Player.isHoldingIngredient())
         {
             GameObject model          = (GameObject)Resources.Load(Player.currentIngred.Model, typeof(GameObject));
             Transform  modelTransform = model.GetComponentsInChildren <Transform>(true)[0];
             Vector3    modelPosition  = modelTransform.position - (new Vector3(0, 15, 0));
             Quaternion modelRotation  = modelTransform.rotation;
             currentItem     = (GameObject)Instantiate(model, modelPosition, modelRotation);
             ingredText.text = Player.currentIngred.ToString();
         }
         else
         {
             ingredText.text = "Nothing";
         }
     }
     else
     {
         if (SimulatedPlayer.isHoldingIngredient())
         {
             GameObject model          = (GameObject)Resources.Load(SimulatedPlayer.currentIngred.Model, typeof(GameObject));
             Transform  modelTransform = model.GetComponentsInChildren <Transform>(true)[0];
             Vector3    modelPosition  = modelTransform.position - (new Vector3(0, 15, 0));
             Quaternion modelRotation  = modelTransform.rotation;
             currentItem     = (GameObject)Instantiate(model, modelPosition, modelRotation);
             ingredText.text = SimulatedPlayer.currentIngred.ToString();
         }
         else
         {
             ingredText.text = "Nothing";
         }
     }
 }
Beispiel #6
0
 private bool canPlaceHeldIngredient()
 {
     return(!ingredientCookedStationComplete && (Player.isHoldingIngredient() || SimulatedPlayer.isHoldingIngredient()) &&
            panContents.Count < maxPanContents);
 }
Beispiel #7
0
 private bool canPlaceHeldIngredient()
 {
     return((Player.isHoldingIngredient() || SimulatedPlayer.isHoldingIngredient()) && plateContents.Count < maxPlateContents);
 }