Esempio n. 1
0
        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;
            Environment     = DBObj.GetEnvironment(EnvironmentID);
            CellStructureID = envCell.CellStructure;    // environment can contain multiple?
            if (Environment.Cells != null && Environment.Cells.ContainsKey(CellStructureID))
            {
                CellStructure = new CellStruct(Environment.Cells[CellStructureID]);
            }

            NumSurfaces = envCell.Surfaces.Count;
        }