Exemple #1
0
    private void GameStep()
    {
        Action agresiveMove = AgresiveMove;
        Action passiveMove  = PassiveMove;

        ActionRandomizer actionRandomizer = new ActionRandomizer();

        switch (AIType)
        {
        case AIType.agressor:
        {
            actionRandomizer.Add(agresiveMove, 75);
            actionRandomizer.Add(passiveMove, 25);
            break;
        }

        case AIType.builder:
        {
            actionRandomizer.Add(agresiveMove, 25);
            actionRandomizer.Add(passiveMove, 75);
            break;
        }

        case AIType.merchant:
        {
            actionRandomizer.Add(passiveMove, 100);
            break;
        }
        }

        Action move = actionRandomizer.GetRandomAction();

        move();
    }
Exemple #2
0
    private void PassiveMove()
    {
        Action levelUpFacility = LevelUpFacility;
        Action trainUnits      = TrainUnits;
        Action expand          = Expand;

        ActionRandomizer actionRandomizer = new ActionRandomizer();

        actionRandomizer.Add(levelUpFacility, 35);
        actionRandomizer.Add(trainUnits, 5);
        actionRandomizer.Add(expand, 60);

        Action action = actionRandomizer.GetRandomAction();

        action();
    }
Exemple #3
0
    private void AgresiveMove()
    {
        Action levelUpFacility = LevelUpFacility;
        Action trainUnits      = TrainUnits;
        Action raid            = Raid;

        ActionRandomizer actionRandomizer = new ActionRandomizer();

        actionRandomizer.Add(levelUpFacility, 50);
        actionRandomizer.Add(trainUnits, 45);
        actionRandomizer.Add(raid, 5);

        Action action = actionRandomizer.GetRandomAction();

        action();
    }