public void ChacheOnegai(OnegaiModel onegaiModel) { var nearArgs = new NearArgs(onegaiModel.OnegaiConditionArg); if (!this.monoInfoIdToOngeais.ContainsKey(nearArgs.TargetMonoInfoId)) { this.monoInfoIdToOngeais[nearArgs.TargetMonoInfoId] = new List <OnegaiModel>(); } if (this.monoInfoIdToOngeais[nearArgs.TargetMonoInfoId].Contains(onegaiModel)) { return; } this.monoInfoIdToOngeais[nearArgs.TargetMonoInfoId].Add(onegaiModel); }
public List <PlayerOnegaiModel> Mediate(List <PlayerOnegaiModel> playerOnegaiModels) { var outputPlayerOnegaiModels = new List <PlayerOnegaiModel> (); foreach (var playerOnegaiModel in playerOnegaiModels) { var nearArgs = new NearArgs(playerOnegaiModel.OnegaiModel.OnegaiConditionArg); if (!nearArgs.IsClear(this.targetMonoInfoID, this.nearMonoInfoIDs)) { continue; } playerOnegaiModel.ToClear(); outputPlayerOnegaiModels.Add(playerOnegaiModel); } return(outputPlayerOnegaiModels); }
public void UnChacheOnegai(OnegaiModel onegaiModel) { var nearArgs = new NearArgs(onegaiModel.OnegaiConditionArg); this.monoInfoIdToOngeais[nearArgs.TargetMonoInfoId].RemoveAll(model => model.Id == onegaiModel.Id); }