public AddDefPosForm(SimulatorManager SM, TypesEnums.UnitSide S) { InitializeComponent(); PrimalSimulator = SM; Side = S; Init(); }
public UnitsForm(SimulatorManager SM, TypesEnums.UnitSide S, TypesEnums.UnitType T) { InitializeComponent(); PrimalSimulator = SM; Side = S; Type = T; Init(); PrimalSimulator.ConsoleBox.WriteLineToConsole("UnitForm READY! Mode: CREATE"); }
public DefencePostionForm(SimulatorManager SM, TypesEnums.UnitSide S) { InitializeComponent(); PrimalSimulator = SM; Side = S; Init(); PrimalSimulator.ConsoleBox.WriteLineToConsole("DefencePositionForm : CREATE MODE"); }
public ListUnitForm(SimulatorManager PM, TypesEnums.UnitSide S) { PrimalManager = PM; Side = S; InitializeComponent(); unitInfo_box.ReadOnly = true; LoadData(); }
public List <IUnit> getUnitsList(TypesEnums.UnitSide S) { if (S == TypesEnums.UnitSide.Ally) { return(Ally); } else { return(Enemy); } }
public List <DefPos> getDefPosList(TypesEnums.UnitSide S) { if (S == TypesEnums.UnitSide.Ally) { return(AllyDefPosts); } else { return(EnemyDefPosts); } }
public int IniciativyPowerGenerator(TypesEnums.UnitSide T) { int tmp_inc = 1; foreach (IUnit U in PrimalSimulator.UnitManager.getUnitsList(T)) { for (int i = 0; i < U.UnitAmount; i++) { tmp_inc += LuckGenerator(U.UnitInciativy); } } return(tmp_inc); }
public DefPos CreateDefPos(TypesEnums.UnitSide S) { DefPos D = new DefPos(NextID); if (S == TypesEnums.UnitSide.Ally) { AllyDefPosts.Add(D); ConsoleBox.WriteLineToConsole("New ALLY DefencePosition CREATE!"); } else { EnemyDefPosts.Add(D); ConsoleBox.WriteLineToConsole("New ENEMY DefencePosition CREATE!"); } return(D); }
public UnitsForm(SimulatorManager SM, TypesEnums.UnitSide S, IUnit U) { InitializeComponent(); PrimalSimulator = SM; Side = S; Type = (TypesEnums.UnitType)U.UnitType; Init(); EditableUnit = U; SelectDefPos = U.MyDefPosition; if (SelectDefPos != null) { l_position.Text = SelectDefPos.ToShortString(); l_leader.Text = SelectDefPos.getLeader(); chbox_hold.Checked = true; } txt_name.Text = U.UnitName; PrimalSimulator.ConsoleBox.WriteLineToConsole("UnitForm READY! Mode: EDIT"); btn_ok.Text = "Edit unit"; }
public int getTotalAmount(TypesEnums.UnitSide S) { int tmp = 0; if (S == TypesEnums.UnitSide.Ally) { foreach (IUnit U in Ally) { tmp += U.UnitAmount; } } else { foreach (IUnit U in Enemy) { tmp += U.UnitAmount; } } return(tmp); }
public int getTotalForce(TypesEnums.UnitSide S) { int tmp = 0; if (S == TypesEnums.UnitSide.Ally) { foreach (IUnit U in Ally) { tmp += U.UnitTotalPower; } } else { foreach (IUnit U in Enemy) { tmp += U.UnitTotalPower; } } return(tmp); }
public DefencePostionForm(SimulatorManager SM, TypesEnums.UnitSide S, DefPos D) { InitializeComponent(); PrimalSimulator = SM; Side = S; num_pos_W.Value = D.WeightPosition; num_pos_H.Value = D.HeightPosition; num_pos_T.Value = D.TallPosition; num_pos_D.Value = D.DefencePosition; num_wall_W.Value = D.WeightWall; num_wall_H.Value = D.HeightWall; num_wall_T.Value = D.TallWall; num_wall_D.Value = D.DefenceWall; txt_name.Text = D.DefPosName; Init(); btn_OK.Text = "Edit"; EditablePosition = D; PrimalSimulator.ConsoleBox.WriteLineToConsole("DefencePositionForm : EDIT MODE"); }
public IUnit CreateUnit(TypesEnums.UnitSide S, TypesEnums.UnitType T) { IUnit U = null; if (T == TypesEnums.UnitType.Infantry) { U = new UnitInfantry(NextID, (char)TypesEnums.UnitType.Infantry, TypesEnums.UnitType.Infantry); } if (T == TypesEnums.UnitType.Archers) { U = new UnitArchers(NextID, (char)TypesEnums.UnitType.Archers, TypesEnums.UnitType.Archers); } if (T == TypesEnums.UnitType.Cavalerly) { U = new UnitCavalerly(NextID, (char)TypesEnums.UnitType.Cavalerly, TypesEnums.UnitType.Cavalerly); } if (U == null) { throw new Exception("Error: Null IUnit object!"); } if (S == TypesEnums.UnitSide.Ally) { Ally.Add(U); } else { Enemy.Add(U); } U.MyLand = LandManager.ActualLandLand; U.MyWeather = LandManager.ActualWeather; U.MyDefPosition = null; ConsoleBox.WriteLineToConsole("New Unit CREATE!"); return(U); }