private static bool HasFlagInternal(string flags, string flagName) { if (!String.IsNullOrEmpty(flags) && !String.IsNullOrEmpty(flagName)) { ActorFlags actorFlags = (ActorFlags)Enum.Parse(typeof(ActorFlags), flags, true); ActorFlags checkFlag = (ActorFlags)Enum.Parse(typeof(ActorFlags), flagName, true); return((actorFlags & checkFlag) == checkFlag); } return(false); }
protected Actor() { maxHealth = health = 1000; prevPos = bCylinder.Position = vel = Vector3k.Zero; speed = angle = pitch = Accum.Zero; prevAngle = prevPitch = Accum.Zero; flags = 0; gravity = Accum.One; bCylinder = new BoundingCylinder(new Accum(16), new Accum(20), new Vector3k(Accum.Zero, Accum.Zero, Accum.Zero)); cam = new Camera(); }
public ActorDefinition(UpperString name, Optional <ActorDefinition> parent, int?editorNumber = null) { Name = name; Parent = parent; EditorNumber = editorNumber; States = new ActorStates(this); if (parent) { Flags = new ActorFlags(parent.Value.Flags); Properties = new ActorProperties(parent.Value.Properties); States = new ActorStates(this, parent.Value.States, parent.Value.Name); ActorType = new ActorTypes(parent.Value.ActorType); } }
public bool HasFlag(ActorFlags flag) { return((flags & flag) == flag); }
public void RemoveFlag(ActorFlags flag) { flags &= flag; }
public void AddFlag(ActorFlags flag) { flags |= flag; }
/// <summary> /// Checks if the specified flags are set /// </summary> public bool CheckFlags(ActorFlags val) { return((flags & val) == val); }
/// <summary> /// Toggles the specified flags /// </summary> /// <param name="val">The flags to toggle</param> public void ToggleFlags(ActorFlags val) { flags ^= val; }
/// <summary> /// Removes the specified flags /// </summary> /// <param name="val">The flags to remove</param> public void RemoveFlags(ActorFlags val) { flags &= ~val; }
/// <summary> /// Sets the specified flags /// </summary> /// <param name="newFlags">The flags to set</param> public void SetFlags(ActorFlags val) { flags |= val; }
/// <summary> /// Destroys the object /// </summary> /// <param name="inflictor">The GameObj that destroyed the object</param> /// <param name="source">The GameObj that caused the object's destruction</param> public virtual void Die(GameObj inflictor, GameObj source) { flags |= ActorFlags.Killed; }