House.House.CreatePlayerHouse C# (CSharp) 메소드

CreatePlayerHouse() 공개 메소드

public CreatePlayerHouse ( string PlayerName, int houseIndex ) : bool
PlayerName string
houseIndex int
리턴 bool
        public bool CreatePlayerHouse(string PlayerName, int houseIndex = 0)
        {
            foreach (PlayerHouses i in playerHouses)
            {
                if (i.PlayerName == PlayerName)
                {
                    return false;
                }
            }

            PlayerHouses playerHouse = new PlayerHouses(PlayerName);
            playerHouses.Add(playerHouse);
            return true;
        }