public static IEnumerable <string> GetFlagList(this IGameEntity entity) { Validation.IsNotNull(entity, "entity"); Validation.IsNotNull(entity.GetFlagContext(), "entity.Flags"); return(entity.GetFlagContext().FlagList); }
public static string GetFlags(this IGameEntity entity) { Validation.IsNotNull(entity, "entity"); Validation.IsNotNull(entity.GetFlagContext(), "entity.Flags"); return(entity.GetFlagContext().Flags); }
public static bool UnsetFlag(this IGameEntity entity, string aFlag) { Validation.IsNotNull(entity, "entity"); Validation.IsNotNullOrEmpty(aFlag, "aFlag"); Validation.IsNotNull(entity.GetFlagContext(), "entity.Flags"); return(entity.GetFlagContext().UnsetFlag(aFlag)); }
public static void SetFlagList(this IGameEntity entity, ICollection <string> flagList) { Validation.IsNotNull(entity, "entity"); Validation.IsNotNull(entity.GetFlagContext(), "entity.Flags"); Validation.IsNotNull(flagList, "flagList"); Validation.IsNotEmpty(flagList); entity.GetFlagContext().FlagList = flagList; }
private bool ExecuteVerb(Tuple <Action, Definition> tuple, IGameEntity entity, string phrase) { var action = tuple.Item1.CastAs <Action>(); var commandDef = tuple.Item2.CastAs <GameCommandDef>(); if (commandDef.AdminOnly && !CommandManager.AdminFlagCheckAndNotify(entity, entity.GetFlagContext())) { return(false); } if (commandDef.LogAction == Globals.LogActionTypes.Always) { Logger.InfoFormat("Entity[{0}, {1}] executed Action[{2}, {3}]", entity.ID, entity.Name, commandDef.ID, commandDef.Name); } action.DynamicInvoke(phrase); return(true); }