public new void Init() { CellStructure = new CellStruct(); StaticObjectIDs = new List <uint>(); StaticObjectFrames = new List <AFrame>(); //StaticObjects = new List<PhysicsObj>(); VisibleCells = new Dictionary <uint, EnvCell>(); }
public EnvCell(DatLoader.FileTypes.EnvCell envCell) : base() { _envCell = envCell; Flags = envCell.Flags; ID = envCell.Id; ShadowObjectIDs = envCell.Surfaces; Pos = new Position(ID, new AFrame(envCell.Position)); Portals = envCell.CellPortals; NumPortals = Portals.Count; StaticObjectIDs = new List <uint>(); StaticObjectFrames = new List <AFrame>(); NumStaticObjects = envCell.StaticObjects.Count; foreach (var staticObj in envCell.StaticObjects) { StaticObjectIDs.Add(staticObj.Id); StaticObjectFrames.Add(new AFrame(staticObj.Frame)); } NumStabs = StaticObjectIDs.Count; VisibleCellIDs = envCell.VisibleCells; RestrictionObj = envCell.RestrictionObj; SeenOutside = envCell.SeenOutside; EnvironmentID = envCell.EnvironmentId; if (EnvironmentID != 0) { Environment = DBObj.GetEnvironment(EnvironmentID); } CellStructureID = envCell.CellStructure; // environment can contain multiple? if (Environment?.Cells != null && Environment.Cells.TryGetValue(CellStructureID, out var cellStruct)) { CellStructure = new CellStruct(cellStruct); } NumSurfaces = envCell.Surfaces.Count; }