internal void Destroy() { Array.Clear(SqState, 0, SqState.Length); Array.Clear(SqFloorHeight, 0, SqFloorHeight.Length); Array.Clear(SqSeatRot, 0, SqSeatRot.Length); staticModel = null; Heightmap = null; SqState = null; SqFloorHeight = null; SqSeatRot = null; }
internal DynamicRoomModel(RoomModel pModel) { this.staticModel = pModel; this.DoorX = staticModel.DoorX; this.DoorY = staticModel.DoorY; this.DoorZ = staticModel.DoorZ; this.DoorOrientation = staticModel.DoorOrientation; this.Heightmap = staticModel.Heightmap; this.MapSizeX = staticModel.MapSizeX; this.MapSizeY = staticModel.MapSizeY; this.ClubOnly = staticModel.ClubOnly; Generate(); }
public Gamemap(Room room) { this.room = room; this.DiagonalEnabled = true; this.mStaticModel = PiciEnvironment.GetGame().GetRoomManager().GetModel(room.ModelName, room.RoomId); 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(); if (room.IsPublic) this.roomLinkInformation = PiciEnvironment.GetGame().GetRoomManager().getLinkedRoomData(room.RoomId); }
public Gamemap(Room room) { this.room = room; this.DiagonalEnabled = true; this.mStaticModel = PiciEnvironment.GetGame().GetRoomManager().GetModel(room.ModelName, room.RoomId); 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(); if (room.IsPublic) { this.roomLinkInformation = PiciEnvironment.GetGame().GetRoomManager().getLinkedRoomData(room.RoomId); } }
internal void Destroy() { userMap.Clear(); mDynamicModel.Destroy(); mCoordinatedItems.Clear(); if (roomLinkInformation != null) { roomLinkInformation.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; roomLinkInformation = null; mDynamicModel = null; room = null; mStaticModel = null; }
internal void Destroy() { userMap.Clear(); mDynamicModel.Destroy(); mCoordinatedItems.Clear(); if (roomLinkInformation != null) roomLinkInformation.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; roomLinkInformation = null; mDynamicModel = null; room = null; mStaticModel = null; }
internal void FillNull(UInt32 pId) { this.Id = pId; this.Name = "Unknown Room"; this.Description = "-"; this.Type = "private"; this.Owner = "-"; this.Category = 0; this.UsersNow = 0; this.UsersMax = 0; this.ModelName = "NO_MODEL"; this.CCTs = ""; this.Score = 0; this.Tags = new List<string>(); this.AllowPets = true; this.AllowPetsEating = false; this.AllowWalkthrough = true; this.Hidewall = false; this.Password = ""; this.Wallpaper = "0.0"; this.Floor = "0.0"; this.Landscape = "0.0"; this.WallThickness = 0; this.FloorThickness = 0; //this.Event = null; this.AllowRightsOverride = false; this.myIcon = new RoomIcon(1, 1, new Dictionary<int, int>()); mModel = PiciEnvironment.GetGame().GetRoomManager().GetModel(ModelName, pId); }
internal void Fill(Room Room) { this.Id = Room.RoomId; this.Name = Room.Name; this.Description = Room.Description; this.Type = Room.Type; this.Owner = Room.Owner; this.Category = Room.Category; this.State = Room.State; this.UsersNow = Room.UsersNow; this.UsersMax = Room.UsersMax; this.ModelName = Room.ModelName; this.CCTs = Room.CCTs; this.Score = Room.Score; this.Tags = new List<string>(); foreach (string tag in Room.Tags.ToArray()) this.Tags.Add(tag); this.AllowPets = Room.AllowPets; this.AllowPetsEating = Room.AllowPetsEating; this.AllowWalkthrough = Room.AllowWalkthrough; this.Hidewall = Room.Hidewall; this.myIcon = Room.Icon; this.Password = Room.Password; this.Event = Room.Event; this.Wallpaper = Room.Wallpaper; this.Floor = Room.Floor; this.Landscape = Room.Landscape; this.FloorThickness = Room.FloorThickness; this.WallThickness = Room.WallThickness; mModel = PiciEnvironment.GetGame().GetRoomManager().GetModel(ModelName, Id); }
internal void Fill(DataRow Row) { this.Id = Convert.ToUInt32(Row["id"]); this.Name = (string)Row["caption"]; this.Description = (string)Row["description"]; this.Type = (string)Row["roomtype"]; this.Owner = (string)Row["owner"]; switch (Row["state"].ToString().ToLower()) { case "open": this.State = 0; break; case "password": this.State = 2; break; case "locked": default: this.State = 1; break; } this.Category = (int)Row["category"]; if (!string.IsNullOrEmpty(Row["active_users"].ToString())) this.UsersNow = (int)Row["active_users"]; else this.UsersNow = 0; this.UsersMax = (int)Row["users_max"]; this.ModelName = (string)Row["model_name"]; this.CCTs = (string)Row["public_ccts"]; this.Score = (int)Row["score"]; this.Tags = new List<string>(); this.AllowPets = PiciEnvironment.EnumToBool(Row["allow_pets"].ToString()); this.AllowPetsEating = PiciEnvironment.EnumToBool(Row["allow_pets_eat"].ToString()); this.AllowWalkthrough = PiciEnvironment.EnumToBool(Row["allow_walkthrough"].ToString()); this.AllowRightsOverride = PiciEnvironment.EnumToBool(Row["allow_rightsoverride"].ToString()); this.Hidewall = PiciEnvironment.EnumToBool(Row["allow_hidewall"].ToString()); this.Password = (string)Row["password"]; this.Wallpaper = (string)Row["wallpaper"]; this.Floor = (string)Row["floor"]; this.Landscape = (string)Row["landscape"]; this.FloorThickness = (int)Row["floorthickness"]; this.WallThickness = (int)Row["wallthickness"]; //this.Event = null; Dictionary<int, int> IconItems = new Dictionary<int,int>(); if (!string.IsNullOrEmpty(Row["icon_items"].ToString())) { foreach (string Bit in Row["icon_items"].ToString().Split('|')) { if (string.IsNullOrEmpty(Bit)) continue; string[] tBit = Bit.Replace('.', ',').Split(','); int a = 0; int b = 0; int.TryParse(tBit[0], out a); if (tBit.Length > 1) int.TryParse(tBit[1], out b); try { if (!IconItems.ContainsKey(a)) IconItems.Add(a, b); } catch (Exception e) { Logging.LogException("Exception: " + e.ToString() + "[" + Bit + "]"); } } } this.myIcon = new RoomIcon((int)Row["icon_bg"], (int)Row["icon_fg"], IconItems); foreach (string Tag in Row["tags"].ToString().Split(',')) { this.Tags.Add(Tag); } mModel = PiciEnvironment.GetGame().GetRoomManager().GetModel(ModelName, Id); }
internal void Fill(DataRow Row) { this.Id = Convert.ToUInt32(Row["id"]); this.Name = (string)Row["caption"]; this.Description = (string)Row["description"]; this.Type = (string)Row["roomtype"]; this.Owner = (string)Row["owner"]; switch (Row["state"].ToString().ToLower()) { case "open": this.State = 0; break; case "password": this.State = 2; break; case "locked": default: this.State = 1; break; } this.Category = (int)Row["category"]; if (!string.IsNullOrEmpty(Row["active_users"].ToString())) { this.UsersNow = (int)Row["active_users"]; } else { this.UsersNow = 0; } this.UsersMax = (int)Row["users_max"]; this.ModelName = (string)Row["model_name"]; this.CCTs = (string)Row["public_ccts"]; this.Score = (int)Row["score"]; this.Tags = new List <string>(); this.AllowPets = PiciEnvironment.EnumToBool(Row["allow_pets"].ToString()); this.AllowPetsEating = PiciEnvironment.EnumToBool(Row["allow_pets_eat"].ToString()); this.AllowWalkthrough = PiciEnvironment.EnumToBool(Row["allow_walkthrough"].ToString()); this.AllowRightsOverride = PiciEnvironment.EnumToBool(Row["allow_rightsoverride"].ToString()); this.Hidewall = PiciEnvironment.EnumToBool(Row["allow_hidewall"].ToString()); this.Password = (string)Row["password"]; this.Wallpaper = (string)Row["wallpaper"]; this.Floor = (string)Row["floor"]; this.Landscape = (string)Row["landscape"]; this.FloorThickness = (int)Row["floorthickness"]; this.WallThickness = (int)Row["wallthickness"]; //this.Event = null; Dictionary <int, int> IconItems = new Dictionary <int, int>(); if (!string.IsNullOrEmpty(Row["icon_items"].ToString())) { foreach (string Bit in Row["icon_items"].ToString().Split('|')) { if (string.IsNullOrEmpty(Bit)) { continue; } string[] tBit = Bit.Replace('.', ',').Split(','); int a = 0; int b = 0; int.TryParse(tBit[0], out a); if (tBit.Length > 1) { int.TryParse(tBit[1], out b); } try { if (!IconItems.ContainsKey(a)) { IconItems.Add(a, b); } } catch (Exception e) { Logging.LogException("Exception: " + e.ToString() + "[" + Bit + "]"); } } } this.myIcon = new RoomIcon((int)Row["icon_bg"], (int)Row["icon_fg"], IconItems); foreach (string Tag in Row["tags"].ToString().Split(',')) { this.Tags.Add(Tag); } mModel = PiciEnvironment.GetGame().GetRoomManager().GetModel(ModelName, Id); }