예제 #1
0
 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);
 }
예제 #2
0
 public Chunk()
 {
     Version = 0;
     Tiles = new Tile[ChunkSize * ChunkSize];
 }
예제 #3
0
 public void OnTileChanged(TileRef tileRef, Tile oldTile)
 {
     IoCManager.Resolve<ILightManager>().RecalculateLightsInView(new RectangleF(tileRef.X, tileRef.Y, 1, 1));
     // Recalculate the scene batches.
     RecalculateScene();
 }
예제 #4
0
        private void PreparePlacementTile(Tile tileType)
        {
            if (tileType.TileDef.IsWall)
            {
                CurrentBaseSprite = ResourceManager.GetSprite("wall");
                CurrentBaseSpriteKey = "wall";
            }
            else
            {
                CurrentBaseSprite = ResourceManager.GetSprite("tilebuildoverlay");
                CurrentBaseSpriteKey = "tilebuildoverlay";
            }

            IsActive = true;
        }