static void Main(string[] args) { Field[][] Fields = new Field[5][]; for (int i = 0; i < Fields.Length; i++) { Fields[i] = new Field[5]; for (int j = 0; j < Fields[i].Length; j++) { Fields[i][j] = new Field(i, j); } } Fields[0][1].SetStateNew(FieldStateForest.GetInstance()); Fields[0][3].SetStateNew(FieldStateImpassable.GetInstance()); Fields[2][2].SetStateNew(FieldStateImpassable.GetInstance()); Fields[2][3].SetStateNew(FieldStateImpassable.GetInstance()); Fields[3][2].SetStateNew(FieldStateImpassable.GetInstance()); Fields[3][3].SetStateNew(FieldStateImpassable.GetInstance()); Fields[1][3].SetStateNew(FieldStateNormal.GetInstance()); Fields[1][4].SetStateNew(FieldStateNormal.GetInstance()); Battlefield bf = new Battlefield(Fields.Select(x => x.ToList()).ToList()); BattleController bc = new BattleController(bf); MarketplaceController mc = new MarketplaceController(); Menu menu = new Menu(); PrepareHeroes(bf); ControllerMediator mediator = new ControllerMediator(bc, mc, menu); mediator.SwitchMode(Controller.ControllerType.Menu); /*bc.ReceiveCommands(); * Console.ReadLine(); */ System.Environment.Exit(0); }
public void Update(Subject Subject) { if (((HealthStat)Subject).ActualHP > Skill.TriggerTreshold) { return; } /*if(WasActivated) * { * return; * } * * WasActivated = true;*/ Console.WriteLine("Passive Skill Triggered"); Console.WriteLine(BattleController); Console.WriteLine(BattleController.Battlefield); Console.WriteLine(BattleController.Battlefield.GetField(SkillOwner)); CommandUseSkill Command = new CommandUseSkill(Skill, BattleController.Battlefield.GetField(SkillOwner), Skill.TriggerBehaviour); BattleController.ExecuteCommand(Command); }
public ControllerMediator(BattleController BattleController, MarketplaceController MarketplaceController, Menu Menu) { this.BattleController = BattleController; this.MarketplaceController = MarketplaceController; this.Menu = Menu; }
public void Finish() { this.BattleController = null; }
public void Init(BattleController BattleController) { this.BattleController = BattleController; }
private ObserverFactory() { this.BattleController = null; }