Ejemplo n.º 1
0
 public GamePlayerInfo(int id, string token = "", string name = "", GamePlayerType type = GamePlayerType.Humam)
 {
     this.ID         = id;
     this.Token      = token;
     this.PlayerType = type;
     this.Name       = name;
 }
Ejemplo n.º 2
0
        public void Throws_Expection_When_Board_Size_Is_Invalid(int boardSize, GamePlayerType gamePlayerType)
        {
            var gameSettings = new GameSettings {
                BoardSize      = boardSize,
                GamePlayerType = gamePlayerType
            };
            var factory = BuildIntelligenceFactory();
            var ai      = factory.Create(gameSettings);

            ai.Should().BeOfType <MiniMaxIntelligence>();
        }
Ejemplo n.º 3
0
        public void Throws_Exception_With_Invalid_Player_Start_Type(GamePlayerType gamePlayerType)
        {
            var ai           = new MockIntelligence();
            var gameSettings = new GameSettings {
                GamePlayerType = gamePlayerType
            };
            var factory = BuildPlayersFactory();

            Action action = () => factory.Create(gameSettings, ai);

            action.ShouldThrow <ArgumentException>();
        }
Ejemplo n.º 4
0
        public static GamePlayerType ToGamePlayerType(this PlayerType pt)
        {
            GamePlayerType value = GamePlayerType.Humam;

            switch (pt)
            {
            case PlayerType.EPT_HUMAN:
                value = GamePlayerType.Humam;
                break;

            case PlayerType.EPT_ROBOT:
                value = GamePlayerType.Robot;
                break;

            case PlayerType.EPT_UAV:
                value = GamePlayerType.UAV;
                break;

            default:
                break;
            }
            return(value);
        }
Ejemplo n.º 5
0
        public static PlayerType ToProtoPlayerType(this GamePlayerType pt)
        {
            PlayerType value = PlayerType.EPT_HUMAN;

            switch (pt)
            {
            case GamePlayerType.Humam:
                value = PlayerType.EPT_HUMAN;
                break;

            case GamePlayerType.Robot:
                value = PlayerType.EPT_ROBOT;
                break;

            case GamePlayerType.UAV:
                value = PlayerType.EPT_UAV;
                break;

            default:
                break;
            }
            return(value);
        }
Ejemplo n.º 6
0
        public static Object GetRes(GamePlayerType type)
        {
            Object resource = null;

            switch (type)
            {
            case GamePlayerType.Humam:
                if (resourceHuman == null)
                {
                    resourceHuman = Resources.Load("Character/Player");
                }
                resource = resourceHuman;
                break;

            case GamePlayerType.UAV:
                if (resourceUAV == null)
                {
                    resourceUAV = Resources.Load("Character/UAV");
                }
                resource = resourceUAV;
                break;

            case GamePlayerType.Robot:
                if (resourceRobot == null)
                {
                    resourceRobot = Resources.Load("Character/Robot");
                }
                resource = resourceRobot;
                break;

            default:
                resource = null;
                break;
            }
            return(resource);
        }
Ejemplo n.º 7
0
        public void Create_AlphaBeta_Intelligence_If_Computer_Exists_When_Board_Size_Is_4_Or_More(int boardSize, GamePlayerType gamePlayerType)
        {
            var gameSettings = new GameSettings {
                BoardSize      = boardSize,
                GamePlayerType = gamePlayerType
            };
            var factory = BuildIntelligenceFactory();
            var ai      = factory.Create(gameSettings);

            ai.Should().BeOfType <AlphaBetaMiniMaxIntelligence>();
        }
Ejemplo n.º 8
0
 public void setGameType(GamePlayerType gamePlayerType)
 {
     this.gamePlayerType = gamePlayerType;
 }
Ejemplo n.º 9
0
 public static void SetGamePlayerType(GamePlayerType gamePlayerType)
 {
     GamePlayerType = gamePlayerType;
 }