public void AddWeapon(int side, String textureName, WeaponType weaponType, float health, float power) { float relativeRotation = side * (float)Math.PI / 2f; Vector2 relativePosition = new Vector2(-((side - 1) % 2) * GetWidth() / 2, ((side - 2) % 2) * GetHeight() / 2); Weapon weapon = new Weapon(this.SPRWorld, this, relativePosition, relativeRotation, textureName, new Vector2(1,1), weaponType, health, power); this.m_Weapons[side] = weapon; }
public void RemoveWeapon(Weapon w) { for (int i = 0; i < m_Weapons.Length; i++) { if (m_Weapons[i] == w) { m_Weapons[i] = null; } } }