/// <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; } }
/// <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; } }
/// <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); }
/// <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)); }
/// <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); }