public ShipFacade( Ship arg_ship ) { hardware_updated = false; ship = arg_ship; weapons = new WeaponFacade[ship.template.weapon_ports.Count]; for (int i = 0; i < ship.weapons.Count(); i++) { weapons[i] = new WeaponFacade(ship.template.weapon_ports[i], null); } }
public void UpdateHardware( ) { thrusters = (ship.thrusters == null) ? null : ship.thrusters.facade; for( int i = 0; i < ship.weapons.Count(); i++ ) { if (ship.weapons[i] != null) { weapons[i] = ship.weapons[i].facade; } // get the current weapon facade else if ( weapons[i].weapon_present ) { // current facade is full, but slot it empty, clear it. weapons[i] = new WeaponFacade(ship.template.weapon_ports[i], null); } } hardware_updated = true; }
public ComponentWeapon(Ship arg_ship, WeaponPort arg_port, float arg_size, WeaponTemplate arg_template) : base(arg_ship, arg_port.position, arg_size, arg_template) { port = arg_port; template = arg_template; explosion = template.explosion * size; facade = new WeaponFacade(port, this); }