public override string ToString() { return(string.Join(" ", new[] { "C", // CurveTo CP1.ToString(), CP2.ToString(), CP3.ToString() })); }
/* * @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(); } }
/* * @name Start * @purpose initialize GameManager object */ void Start() { Debug.Log("GameManagerCreated"); //populates DeckId Class and then creates decks and populates the decklist CreateDecks(); //populates decks in deck list gameObject.AddComponent <phpImport>(); // sets initial round number Round = 1; //this is how we inialize objects //initializing Human Person Player PersonGO = new GameObject("Person"); PersonGO.AddComponent <Human>(); Person = GameObject.Find("Person").GetComponent <Human>(); Person.InitializeObjects("PlayerScoreText", "PlayerRoundText", "Hand", "Region Card Placement", "Condition Card Placement", "Plant Card Placement", "Invertebrate Card Placement", "Animal Card Placement", "Special Region Card Placement", "Multiplayer Card Placement", "Microbe Card Placement", "Fungi Card Placement", "Discard Pile Placement", "Human Card Placement", "PlayerColor", "PlayerDeckText", "PlayerScoreText", "ComputerOneScoreText", "ComputerTwoScoreText", "ComputerThreeScoreText", "Person"); //Initilizing CP1 Player CP1GO = new GameObject("CP1"); CP1GO.AddComponent <Computer>(); CP1 = GameObject.Find("CP1").GetComponent <Computer>(); CP1.InitializeObjects("Computer One Board/Main Images and Placements/Computer1Button/ComputerOneScoreText", "Computer One Board/Main Images and Placements/ComputerOneRoundText", "Computer One Board/CP1Hand", "Computer One Board/Region Card Placement", "Computer One Board/Condition Card Placement", "Computer One Board/Plant Card Placement", "Computer One Board/Invertebrate Card Placement", "Computer One Board/Animal Card Placement", "Computer One Board/Special Region Card Placement", "Computer One Board/Multiplayer Card Placement", "Computer One Board/Microbe Card Placement", "Computer One Board/Fungi Card Placement", "Computer One Board/Discard Pile Placement", "Computer One Board/Human Card Placement", "CP1Color", "CP1DeckText", "Computer One Board/Main Images and Placements/PlayerButton/PlayerScoreText", "Computer One Board/Main Images and Placements/Computer1Button/ComputerOneScoreText", "Computer One Board/Main Images and Placements/Computer2Button/ComputerTwoScoreText", "Computer One Board/Main Images and Placements/Computer3Button/ComputerThreeScoreText", "CP1"); //Initilizing CP2 Player CP2GO = new GameObject("CP2"); CP2GO.AddComponent <Computer>(); CP2 = GameObject.Find("CP2").GetComponent <Computer>(); CP2.InitializeObjects("Computer Two Board/Main Images and Placements/Computer2Button/ComputerTwoScoreText", "Computer Two Board/Main Images and Placements/ComputerTwoRoundText", "Computer Two Board/CP2Hand", "Computer Two Board/Region Card Placement", "Computer Two Board/Condition Card Placement", "Computer Two Board/Plant Card Placement", "Computer Two Board/Invertebrate Card Placement", "Computer Two Board/Animal Card Placement", "Computer Two Board/Special Region Card Placement", "Computer Two Board/Multiplayer Card Placement", "Computer Two Board/Microbe Card Placement", "Computer Two Board/Fungi Card Placement", "Computer Two Board/Discard Pile Placement", "Computer Two Board/Human Card Placement", "CP2Color", "CP2DeckText", "Computer Two Board/Main Images and Placements/PlayerButton/PlayerScoreText", "Computer Two Board/Main Images and Placements/Computer1Button/ComputerOneScoreText", "Computer Two Board/Main Images and Placements/Computer2Button/ComputerTwoScoreText", "Computer Two Board/Main Images and Placements/Computer3Button/ComputerThreeScoreText1", "CP2"); //Initilizing CP3 Player CP3GO = new GameObject("CP3"); CP3GO.AddComponent <Computer>(); CP3 = GameObject.Find("CP3").GetComponent <Computer>(); CP3.InitializeObjects("Computer Three Board/Main Images and Placements/Computer3Button/ComputerThreeScoreText", "Computer Three Board/Main Images and Placements/ComputerThreeRoundText", "Computer Three Board/CP3Hand", "Computer Three Board/Region Card Placement", "Computer Three Board/Condition Card Placement", "Computer Three Board/Plant Card Placement", "Computer Three Board/Invertebrate Card Placement", "Computer Three Board/Animal Card Placement", "Computer Three Board/Special Region Card Placement", "Computer Three Board/Multiplayer Card Placement", "Computer Three Board/Microbe Card Placement", "Computer Three Board/Fungi Card Placement", "Computer Three Board/Discard Pile Placement", "Computer Three Board/Human Card Placement", "CP3Color", "CP3DeckText", "Computer Three Board/Main Images and Placements/PlayerButton/PlayerScoreText", "Computer Three Board/Main Images and Placements/Computer1Button/ComputerOneScoreText", "Computer Three Board/Main Images and Placements/Computer2Button/ComputerTwoScoreText", "Computer Three Board/Main Images and Placements/Computer3Button/ComputerThreeScoreText", "CP3"); /******************************************************/ /******************************************************/ //this will all be moved to the pick deck class but for now we have the game manager being created from the main camera inthe playerboard scene //hard codes deck for now Person.Deck = Decks[0]; CP1.Deck = Decks[1]; CP2.Deck = Decks[2]; CP3.Deck = Decks[3]; //instantiates colors and names AppalachianColor = new Color32(166, 135, 82, 128); AlleghenyColor = new Color32(58, 102, 44, 128); ClarionRiverColor = new Color32(116, 126, 140, 128); PeatBogsColor = new Color32(124, 56, 58, 128); Allegheny = "Allegheny National Forest"; Appalachian = "Appalachian Homestead"; Peat = "Peat Bogs"; Clarion = "Clarion River"; //sets human card values Person.Deck.DeckName = Allegheny; Person.Deck.DeckColor = AlleghenyColor; CP1.Deck.DeckName = Appalachian; CP1.Deck.DeckColor = AppalachianColor; CP2.Deck.DeckName = Peat; CP2.Deck.DeckColor = PeatBogsColor; CP3.Deck.DeckName = Clarion; CP3.Deck.DeckColor = ClarionRiverColor; }