public int GetDeployableWeaponCount(System.Type weapon) => this._weapons.GetMaxDeployableWeaponCount(weapon) - this.DeploymentPoints.Count <DeploymentPoint>((Func <DeploymentPoint, bool>)(dp => dp.IsDeployed && SiegeWeaponCollection.GetWeaponType((ScriptComponentBehaviour)dp.DeployedWeapon) == weapon));
private bool DeployWeaponFrom(DeploymentPoint dp) { IEnumerable <System.Type> source = dp.DeployableWeaponTypes.Where <System.Type>((Func <System.Type, bool>)(t => this.deploymentPoints.Count <DeploymentPoint>((Func <DeploymentPoint, bool>)(dep => dep.IsDeployed && SiegeWeaponCollection.GetWeaponType((ScriptComponentBehaviour)dep.DeployedWeapon) == t)) < this.weapons.GetMaxDeployableWeaponCount(t))); if (source.IsEmpty <System.Type>()) { return(false); } System.Type t1 = source.MaxBy <System.Type, float>((Func <System.Type, float>)(t => this.GetWeaponValue(t))); dp.Deploy(t1); return(true); }
public void Deploy(System.Type t) { this.DeployedWeapon = this._weapons.First <SynchedMissionObject>((Func <SynchedMissionObject, bool>)(w => SiegeWeaponCollection.GetWeaponType((ScriptComponentBehaviour)w) == t)); this.OnDeploymentStateChangedAux(this.DeployedWeapon); this.ToggleDeploymentPointVisibility(false); this.ToggleDeployedWeaponVisibility(true); }