void defenderSending() { if (enemyList.Count != 0) { foreach (Ships thisS in enemyList) { userAction.registerEnemy(thisS); } if (defenderSent == false) { defender thisD = Instantiate(thisDefenderShip); thisD.transform.position = this.transform.position; thisD.baseStation = this; defenderSent = true; } } }
public void Spawn_defender(Vector2 grid_pos) { defender new_def = Instantiate(def, grid_pos, Quaternion.identity) as defender; new_def.transform.parent = parent_defender.transform; }
public void Set_selected_defender(defender selected_defender) { def = selected_defender; }
public Form1() { InitializeComponent(); this.textBox1.KeyPress += onTextChanged; this.textBox2.KeyPress += onTextChanged; this.textBox3.KeyPress += onTextChanged; this.textBox4.KeyPress += onTextChanged; this.textBox5.KeyPress += onTextChanged; this.textBox6.KeyPress += onTextChanged; this.textBox7.KeyPress += onTextChanged; this.textBox8.KeyPress += onTextChanged; this.textBox9.KeyPress += onTextChanged; this.textBox10.KeyPress += onTextChanged; this.textBox11.KeyPress += onTextChanged; this.textBox12.KeyPress += onTextChanged; this.textBox13.KeyPress += onTextChanged; this.textBox14.KeyPress += onTextChanged; this.textBox15.KeyPress += onTextChanged; this.textBox16.KeyPress += onTextChanged; this.textBox17.KeyPress += onTextChanged; this.textBox18.KeyPress += onTextChanged; this.textBox19.KeyPress += onTextChanged; this.textBox20.KeyPress += onTextChanged; this.textBox21.KeyPress += onTextChanged; this.textBox22.KeyPress += onTextChanged; this.textBox23.KeyPress += onTextChanged; this.textBox24.KeyPress += onTextChanged; this.textBox1.TextChanged += fieldTextChanged; this.textBox2.TextChanged += fieldTextChanged; this.textBox3.TextChanged += fieldTextChanged; this.textBox4.TextChanged += fieldTextChanged; this.textBox5.TextChanged += fieldTextChanged; this.textBox6.TextChanged += fieldTextChanged; this.textBox7.TextChanged += fieldTextChanged; this.textBox8.TextChanged += fieldTextChanged; this.textBox9.TextChanged += fieldTextChanged; this.textBox10.TextChanged += fieldTextChanged; this.textBox11.TextChanged += fieldTextChanged; this.textBox12.TextChanged += fieldTextChanged; this.textBox13.TextChanged += fieldTextChanged; this.textBox14.TextChanged += fieldTextChanged; this.textBox15.TextChanged += fieldTextChanged; this.textBox16.TextChanged += fieldTextChanged; this.textBox17.TextChanged += fieldTextChanged; this.textBox18.TextChanged += fieldTextChanged; this.textBox19.TextChanged += fieldTextChanged; this.textBox20.TextChanged += fieldTextChanged; this.textBox21.TextChanged += fieldTextChanged; this.textBox22.TextChanged += fieldTextChanged; this.textBox23.TextChanged += fieldTextChanged; this.textBox24.TextChanged += fieldTextChanged; attackerInfo = new attacker(); attackerInfo.attack_modifier = 1; attackerInfo.defence_modifier = 1; attackerInfo.life_modifier = 1; attackerInfo.troops = new Int64[12]; defenderInfo = new defender(); defenderInfo.attack_modifier = 1; defenderInfo.defence_modifier = 1; defenderInfo.life_modifier = 1; defenderInfo.troops = new Int64[12]; result = new battleResult(); result.attackerTroops = new Int64[12]; result.defenderTroops = new Int64[12]; result.result = 0; result.fortification = new Int64[5]; }