Example #1
0
        public Gamemap(Room room)
        {
            this._room = room;
            this.DiagonalEnabled = true;

            mStaticModel = PlusEnvironment.GetGame().GetRoomManager().GetModel(room.ModelName);
            if (mStaticModel == null)
            {
                PlusEnvironment.GetGame().GetRoomManager().LoadModel(room.ModelName);
                mStaticModel = PlusEnvironment.GetGame().GetRoomManager().GetModel(room.ModelName);
            }

            if (mStaticModel == null)
                return;

            mDynamicModel = new DynamicRoomModel(mStaticModel);

            mCoordinatedItems = new ConcurrentDictionary<Point, List<int>>();

            gotPublicPool = room.RoomData.Model.gotPublicPool;
            mGameMap = new byte[Model.MapSizeX, Model.MapSizeY];
            mItemHeightMap = new double[Model.MapSizeX, Model.MapSizeY];

            userMap = new ConcurrentDictionary<Point, List<RoomUser>>();
        }
Example #2
0
        public void Dispose()
        {
            _userMap.Clear();
            _dynamicModel.Destroy();
            _coordinatedItems.Clear();

            Array.Clear(_gameMap, 0, _gameMap.Length);
            Array.Clear(_userItemEffect, 0, _userItemEffect.Length);
            Array.Clear(_itemHeightMap, 0, _itemHeightMap.Length);

            _userMap          = null;
            _gameMap          = null;
            _userItemEffect   = null;
            _itemHeightMap    = null;
            _coordinatedItems = null;

            _dynamicModel = null;
            _room         = null;
            _model        = null;
        }
Example #3
0
        public Gamemap(Room room)
        {
            _room           = room;
            DiagonalEnabled = true;
            StaticModel     = PlusEnvironment.GetGame().GetRoomManager().GetModel(room.ModelName);
            if (StaticModel == null)
            {
                PlusEnvironment.GetGame().GetRoomManager().LoadModel(room.ModelName);
                StaticModel = PlusEnvironment.GetGame().GetRoomManager().GetModel(room.ModelName);
            }
            if (StaticModel == null)
            {
                return;
            }

            Model             = new DynamicRoomModel(StaticModel);
            mCoordinatedItems = new ConcurrentDictionary <Point, List <int> >();
            gotPublicPool     = room.RoomData.Model.gotPublicPool;
            GameMap           = new byte[Model.MapSizeX, Model.MapSizeY];
            mItemHeightMap    = new double[Model.MapSizeX, Model.MapSizeY];
            userMap           = new ConcurrentDictionary <Point, List <RoomUser> >();
        }
Example #4
0
        public void Dispose()
        {
            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;
            this._room = null;
            mStaticModel = null;
        }