public Gamemap(Room room) { this.room = room; this.DiagonalEnabled = true; this.mStaticModel = SilverwaveEnvironment.GetGame().GetRoomManager().GetModel(room.ModelName); if (mStaticModel == null) throw new Exception("No modeldata found for roomID " + room.RoomId); this.mDynamicModel = new DynamicRoomModel(this.mStaticModel); this.mCoordinatedItems = new Hashtable(); this.gotPublicPool = room.RoomData.Model.gotPublicPool; this.mGameMap = new byte[Model.MapSizeX, Model.MapSizeY]; this.mItemHeightMap = new double[Model.MapSizeX, Model.MapSizeY]; userMap = new Hashtable(); }
public Gamemap(string model) { try { this.DiagonalEnabled = true; this.mStaticModel = SilverwaveEnvironment.GetGame().GetRoomManager().GetModel(model); if (mStaticModel == null) throw new Exception("No modeldata found for roomID " + room.RoomId); this.mDynamicModel = new DynamicRoomModel(this.mStaticModel); this.mCoordinatedItems = new Hashtable(); this.gotPublicPool = false; this.mGameMap = new byte[Model.MapSizeX, Model.MapSizeY]; this.mItemHeightMap = new double[Model.MapSizeX, Model.MapSizeY]; userMap = new Hashtable(); } catch (Exception e) { Console.WriteLine(e); } }
internal void Destroy() { userMap.Clear(); mDynamicModel.Destroy(); mCoordinatedItems.Clear(); Array.Clear(mGameMap, 0, mGameMap.Length); Array.Clear(mUserItemEffect, 0, mUserItemEffect.Length); Array.Clear(mItemHeightMap, 0, mItemHeightMap.Length); userMap = null; mGameMap = null; mUserItemEffect = null; mItemHeightMap = null; mCoordinatedItems = null; mDynamicModel = null; room = null; mStaticModel = null; }