/// <summary> /// Removes the world object based on the given key. /// </summary> /// <param name="Key">The key value of the object to remove.</param> /// <returns>Whether or not that object was succesfull removed.</returns> public virtual bool RemoveWorldObject(Type Type, int X, int Y) { GridWorldObject <SS, DS> GWO = this.WorldObjects.First(x => x.X == X && x.Y == Y && x.GetType( ).Equals(Type)); this.hash ^= GWO.GetHashCode( ); return(this.WorldObjects.Remove(GWO)); }
/// <summary> /// Adds the given world object to the world. /// </summary> /// <param name="GWO">The object to add.</param> public virtual void AddWorldObject(GridWorldObject <SS, DS> GWO) { this.hash ^= GWO.GetHashCode( ); this.WorldObjects.Add(GWO); }