public void OnDeleteSuppression(AgentModel actor) { SuppressAction suppressAction = null; foreach (SuppressAction ta in this.agentList) { if (actor == ta.model) { suppressAction = ta; break; } } if (suppressAction == null) { print("Error to founding agent"); return; } if (suppressAction.GetControllable() == false) { print("this agent cannot controllable"); return; } this.suppressingAgentList.Remove(suppressAction); }
//이거 public void OnSetSuppression(AgentModel actor) { SuppressAction suppressAction = null; foreach (SuppressAction ta in this.agentList) { if (actor == ta.model) { suppressAction = ta; break; } } if (suppressAction == null) { print("Error to founding agent"); return; } if (suppressAction.GetControllable() == false) { print("this agent cannot controllable"); return; } this.suppressingAgentList.Add(suppressAction); /* * if (target is AgentModel) * { * this.suppressingAgentList.Add(suppressAction); * * actor.StartSuppressAgent((AgentModel)target, suppressAction, SuppressType.UNCONTROLLABLE); * } * else if (target is OfficerModel) { * actor.StartSuppressAgent((OfficerModel)target, suppressAction, SuppressType.UNCONTROLLABLE); * } * else if (target is CreatureModel) { * actor.SuppressCreature((CreatureModel)target, suppressAction); * } * SuppressAction sa = new SuppressAction (actor); * sa.weapon = SuppressAction.Weapon.GUN; * AutoCommandManager.instance.SetSuppressAgent(target, sa); */ }
/// <summary> /// 직원이 패닉상태인지 확인함 /// </summary> private void InitAgentList() { List <AgentModel> list = new List <AgentModel>(currentSefira.agentList.ToArray()); if (this.suppressingAgentList == null) { this.suppressingAgentList = new List <SuppressAction>(); } else { this.suppressingAgentList.Clear(); } foreach (AgentModel model in list) { bool check = false; //패닉 상태인지 확인하는 과정이 필요함 foreach (SuppressAction sa in agentList) { if (sa.model == model) { check = true; break; } } if (check) { break; } SuppressAction action = new SuppressAction(model); if (model.panicFlag != true && model.GetState() != AgentAIState.CANNOT_CONTROLL) { action.SetControllable(true); } else { action.SetControllable(false); } this.agentList.Add(action); } }
public static int CompareByLifestyle(SuppressAction a, SuppressAction b) { return(AgentModel.CompareByLifestyle(a.model, b.model)); }