public void UpdatePathFinderMapCoords() { var basePoint = (MapBlock.BlockId - World.TheWorld.AvatarBlockId + LiveMap.ActiveQpoint) * Constants.MAP_BLOCK_SIZE; foreach (var point in LiveCoords.GetAllBlockPoints()) { var pnt = basePoint + BaseMapBlock.GetInBlockCoords(point); m_liveMap.Cells[point.X, point.Y].PathMapCoords = pnt; } }
public virtual void AddedToBlock(BaseMapBlock _mapBlock) { BlockId = _mapBlock.BlockId; WorldRoomRectangle = new Rct ( RoomRectangle.Left + BlockId.X*Constants.MAP_BLOCK_SIZE, RoomRectangle.Top + BlockId.Y*Constants.MAP_BLOCK_SIZE, RoomRectangle.Width, RoomRectangle.Height); RandomSeed = _mapBlock.RandomSeed + RoomRectangle.LeftTop.GetHashCode(); }
public virtual void AddedToBlock(BaseMapBlock _mapBlock) { BlockId = _mapBlock.BlockId; WorldRoomRectangle = new Rct ( RoomRectangle.Left + BlockId.X * Constants.MAP_BLOCK_SIZE, RoomRectangle.Top + BlockId.Y * Constants.MAP_BLOCK_SIZE, RoomRectangle.Width, RoomRectangle.Height); RandomSeed = _mapBlock.RandomSeed + RoomRectangle.LeftTop.GetHashCode(); }
public static void Fill(this BaseMapBlock _block, Random _rnd, WorldLayer _layer, IEnumerable <ETerrains> _defaultTerrains, Rct _rct) { var def = _defaultTerrains.ToArray(); for (var i = 0; i < _rct.Width; ++i) { for (var j = 0; j < _rct.Height; ++j) { _block.Map[i + _rct.Left, j + _rct.Top] = def.RandomItem(_rnd); } } }
public MapBlock(Point _blockId, BaseMapBlock _baseMapBlock) : this(_blockId) { foreach (var point in Rect.AllPoints) { Map[point.X, point.Y] = _baseMapBlock.Map[point.X, point.Y]; } foreach (var room in _baseMapBlock.Rooms) { Rooms.Add(room); } RandomSeed = _baseMapBlock.RandomSeed; }
public static void Clear(this BaseMapBlock _block, Random _rnd, WorldLayer _layer, IEnumerable <ETerrains> _defaultTerrains) { Fill(_block, _rnd, _layer, _defaultTerrains, BaseMapBlock.Rect); }
private Point GetCenterLiveCell() { var inBlock = BaseMapBlock.GetInBlockCoords(World.TheWorld.Avatar.GeoInfo.WorldCoords); return(CenterLiveBlock * Constants.MAP_BLOCK_SIZE + inBlock); }