public void SendChangeTile(int x, int y, Tile newTile) { var mapMgr = (MapManager) IoCManager.Resolve<IMapManager>(); NetOutgoingMessage netMessage = NetClient.CreateMessage(); netMessage.Write((int)x); netMessage.Write((int)y); netMessage.Write((uint)newTile); NetClient.SendMessage(netMessage, NetDeliveryMethod.ReliableOrdered); }
public Chunk() { Version = 0; Tiles = new Tile[ChunkSize * ChunkSize]; }
public void OnTileChanged(TileRef tileRef, Tile oldTile) { IoCManager.Resolve<ILightManager>().RecalculateLightsInView(new RectangleF(tileRef.X, tileRef.Y, 1, 1)); // Recalculate the scene batches. RecalculateScene(); }
private void PreparePlacementTile(Tile tileType) { if (tileType.TileDef.IsWall) { CurrentBaseSprite = ResourceManager.GetSprite("wall"); CurrentBaseSpriteKey = "wall"; } else { CurrentBaseSprite = ResourceManager.GetSprite("tilebuildoverlay"); CurrentBaseSpriteKey = "tilebuildoverlay"; } IsActive = true; }