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(); }
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(); }
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(); }