コード例 #1
0
 /// <summary>
 /// Adds one or more properties to this object.
 /// </summary>
 /// <param name="flag">The property or properties to add.</param>
 public void AddFlag(Enums.ObjectPropertiesFlags flag)
 {
     if (!HasFlag(flag))
     {
         this.Flags += (uint)flag;
     }
 }
コード例 #2
0
 /// <summary>
 /// Removes one or more properties from this object.
 /// </summary>
 /// <param name="flag">The property or properties to remove.</param>
 public void RemoveFlag(Enums.ObjectPropertiesFlags flag)
 {
     if (this.HasFlag(flag))
     {
         this.Flags -= (uint)flag;
     }
 }
コード例 #3
0
ファイル: Map.Tile.cs プロジェクト: uvbs/bot-2016
 /// <summary>
 /// Checks whether this tile contains an object with one or more specified flags.
 /// </summary>
 /// <param name="c">The client to get item properties from.</param>
 /// <param name="flags">The flags to check for. Can be more than one.</param>
 /// <returns></returns>
 public bool ContainsObjectProperty(Enums.ObjectPropertiesFlags flags)
 {
     foreach (TileObject to in this.GetObjects())
     {
         if (to.HasFlag(flags))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #4
0
ファイル: Item.cs プロジェクト: uvbs/bot-2016
 /// <summary>
 /// Checks whether this item has a given property.
 /// </summary>
 /// <param name="flag">The property to check for.</param>
 /// <returns></returns>
 public bool HasFlag(Enums.ObjectPropertiesFlags flag)
 {
     if (this.Client == null)
     {
         return(false);
     }
     if (this.Properties == null)
     {
         this.Properties = this.Client.GetObjectProperty(this.ID);
     }
     return(this.Properties.HasFlag(flag));
 }
コード例 #5
0
 /// <summary>
 /// Checks whether this object has a given property or properties.
 /// </summary>
 /// <param name="flag">The property or properties to check for.</param>
 /// <returns></returns>
 public bool HasFlag(Enums.ObjectPropertiesFlags flag)
 {
     return((this.Flags & (uint)flag) == (uint)flag);
 }