Exemple #1
0
    void Start()
    {
        game             = new FourInRowGame(7, 6, 2, 4, this);
        aICore           = new AICore(game, 1000);
        firstImg.sprite  = GameManager.firstPlayerSkin.roundSprite;
        secondImg.sprite = GameManager.secondPlayerSkin.roundSprite;
        PrepareScoreSize(firstImg);
        PrepareScoreSize(secondImg);
        scoreText.text = game.GetScore();
        InitiatePools();
        pauseSlider.gameObject.SetActive(!(GameManager.CurrentPlayMode == PlayMode.TwoPlayers));
        switch (GameManager.CurrentPlayMode)
        {
        case PlayMode.Multiplayer:
            break;

        case PlayMode.TwoAI:
            playTask = BothAIPlayTask;
            break;

        case PlayMode.TwoPlayers:
            playTask = TwoPlayersTask;
            break;

        case PlayMode.WithAI:
            playTask = PlayWithAITask;
            break;
        }
    }
Exemple #2
0
#pragma warning restore IDE0044 // Добавить модификатор только для чтения
    public AICore(FourInRowGame fourInGame, int learnCount)
    {
        game          = fourInGame;
        LearnCount    = learnCount;
        RedDataset    = new List <DataExample>();
        YellowDataset = new List <DataExample>();

        neyralNetwork = new NeyralNetwork(
            new NeyralNetworkConfig(0.5, 0.5),
            new int[] {
            game.FieldSize.X *game.FieldSize.Y * 2,
            168, 84, 42, 20,
            game.FieldSize.X
        });
    }