Пример #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;
        }