示例#1
0
 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);
 }
示例#2
0
 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();
 }
示例#3
0
        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);
            }
        }
示例#4
0
 public bool HasFlag(ActorFlags flag)
 {
     return((flags & flag) == flag);
 }
示例#5
0
 public void RemoveFlag(ActorFlags flag)
 {
     flags &= flag;
 }
示例#6
0
 public void AddFlag(ActorFlags flag)
 {
     flags |= flag;
 }
示例#7
0
 /// <summary>
 /// Checks if the specified flags are set
 /// </summary>
 public bool CheckFlags(ActorFlags val)
 {
     return((flags & val) == val);
 }
示例#8
0
 /// <summary>
 /// Toggles the specified flags
 /// </summary>
 /// <param name="val">The flags to toggle</param>
 public void ToggleFlags(ActorFlags val)
 {
     flags ^= val;
 }
示例#9
0
 /// <summary>
 /// Removes the specified flags
 /// </summary>
 /// <param name="val">The flags to remove</param>
 public void RemoveFlags(ActorFlags val)
 {
     flags &= ~val;
 }
示例#10
0
 /// <summary>
 /// Sets the specified flags
 /// </summary>
 /// <param name="newFlags">The flags to set</param>
 public void SetFlags(ActorFlags val)
 {
     flags |= val;
 }
示例#11
0
 /// <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;
 }