public bool TryGetEntity <T>(DynamicValueContext context, out T entity) where T : class, IEntity { if (context.type == DynamicValueHolderType.CharacterAction) { CharacterActionValueContext characterActionValueContext = context as CharacterActionValueContext; if (characterActionValueContext != null) { T val = characterActionValueContext.relatedCharacterStatus as T; if (val != null) { entity = val; return(true); } } else { Log.Error("Cannot use ApplicationHolder when cast target context is " + context.GetType().Name + ".", 26, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\TargetSelectors\\ApplicationHolderSelector.cs"); } } else { Log.Error($"Cannot use ApplicationHolder when cast object type is {context.type} ({context.GetType().Name}).", 31, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\TargetSelectors\\ApplicationHolderSelector.cs"); } entity = null; return(false); }
public override bool GetValue(DynamicValueContext context, out int value) { CharacterActionValueContext characterActionValueContext = context as CharacterActionValueContext; if (characterActionValueContext != null && characterActionValueContext.relatedCharacterActionValue.HasValue) { value = characterActionValueContext.relatedCharacterActionValue.Value; return(true); } value = 0; return(false); }
public bool TryGetEntity <T>(DynamicValueContext context, out T entity) where T : class, IEntity { CharacterActionValueContext characterActionValueContext = context as CharacterActionValueContext; if (characterActionValueContext != null) { int ownerId = characterActionValueContext.relatedCharacterStatus.ownerId; return(characterActionValueContext.fightStatus.TryGetEntity(ownerId, out entity)); } Log.Error($"Cannot use Owner Of Effect Holder in {context}", 29, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\TargetSelectors\\OwnerOfEffectHolderSelector.cs"); entity = null; return(false); }
public bool TryGetEntity <T>(DynamicValueContext context, out T entity) where T : class, IEntity { CharacterActionValueContext characterActionValueContext = context as CharacterActionValueContext; if (characterActionValueContext != null) { ICharacterEntity relatedCharacterStatus = characterActionValueContext.relatedCharacterStatus; if (relatedCharacterStatus is T) { entity = (T)relatedCharacterStatus; return(true); } } else { Log.Error($"Cannot use Effect Holder in {context}", 23, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\TargetSelectors\\EffectHolderSelector.cs"); } entity = null; return(false); }