Exemplo n.º 1
0
 private void SetTile(object sender, SetTileEventArgs e)
 {
     this.map[e.X, e.Z] = new Tile()
     {
         X             = e.X,
         Z             = e.Z,
         Height        = e.Height,
         Model         = e.Model,
         Topping       = e.Topping,
         IsInteractive = e.IsInteractive
     };
 }
Exemplo n.º 2
0
            private void OnSetTile(NetIncomingMessage msg)
            {
                var x           = msg.ReadInt32();
                var z           = msg.ReadInt32();
                var height      = msg.ReadSingle();
                var model       = msg.ReadString();
                var topping     = msg.ReadString();
                var interactive = msg.ReadBoolean();

                var ea = new SetTileEventArgs(
                    x, z,
                    height,
                    string.IsNullOrWhiteSpace(model) ? null : model,
                    string.IsNullOrWhiteSpace(topping) ? null : topping,
                    interactive);

                if (this.SetTile != null)
                {
                    this.SetTile(this.network, ea);
                }
            }