예제 #1
0
    /*
     *  @name       NextPlayer()
     *  @purpose    This function is used to change the canvas and is basically the game loop. at teh end of each players turn this is called.
     *  For the human it is called when a card is discarded. for a computer it is called at the end of the courtine.
     *
     */
    public void NextPlayer(string pPlayerName)
    {
        //quickly goes through each canvas and sets the correct score values that way they are all up to date
        HideShow.ShowPlayer();
        Person.ChangeAllScore();
        HideShow.ShowCP3();
        CP3.ChangeAllScore();
        HideShow.ShowCP2();
        CP2.ChangeAllScore();
        HideShow.ShowCP1();
        CP1.ChangeAllScore();

        //goes through each player and executes accordingly
        if (pPlayerName == "Person")
        {
            //Cursor.visible = false; //hides the mouse from the user
            //Cursor.lockState = CursorLockMode.Locked; //you cannot use the cursor
            HideShow.ShowCP1();
            CP1.CreateDeckInfo();
            CP1.StartTurn();
        }
        else if (pPlayerName == "CP1")
        {
            HideShow.ShowCP2();
            CP2.CreateDeckInfo();
            CP2.StartTurn();
        }
        else if (pPlayerName == "CP2")
        {
            HideShow.ShowCP3();
            CP3.CreateDeckInfo();
            CP3.StartTurn();
        }
        else if (pPlayerName == "CP3")
        {
            //updates the game manager round
            UpdateRound();
            //shows mouse
            Cursor.visible = true;
            //enables mouse
            Cursor.lockState = CursorLockMode.None;
            //shows the human player
            HideShow.ShowPlayer();
            //after the round has changed the player can draw again
            Person.CanDraw = true;
            //starts the players turn automatically
            Person.StartTurn();
        }
    }
예제 #2
0
 public static void HideOrShow(HideShow packet)
 {
     if (packet.hideShow == 1)
     {
         hideTaskbar();
     }
     else if (packet.hideShow == 2)
     {
         showTaskbar();
     }
     else if (packet.hideShow == 3)
     {
         hideDesktop();
     }
     else if (packet.hideShow == 4)
     {
         showDesktop();
     }
 }