/// <summary> /// Initializes a new instance of the <see cref="BlockEventArgs"/> class. /// Initializes a new instance of the <see cref="BlockEventArgs"/>. Send a block changed event. /// </summary> /// <param name="b"> /// The block /// </param> /// <param name="m"> /// The raw message. /// </param> /// <param name="origin"> /// The room where the block originated from. /// </param> internal BlockEventArgs(Block b, Message m, Room origin = null) { Origin = origin ?? Bot.CurrentRoom; this.placed = b; this.placer = b.Placer; RawMessage = m; }
public void Build(Block b) { if (this.C != null) { this.C.Send(this.R.RoomKey, b.Z, b.X, b.Y, b.Id, b.Direction); Thread.Sleep(this.Bot.BlockDelay); } }
/// <summary> /// Called when a user adds Sci-Fi blocks or spikes. /// </summary> /// <param name="m">The message.</param> public void OnAddScifiOrSpikes(Message m) { // Extract data. int x = m.GetInteger(0), y = m.GetInteger(1), id = m.GetInteger(2), rotation = m.GetInteger(3); // Update relevant objects. var b = new Block(id, x, y, 0, rotation); this._in.Source.Map[x, y, 0] = b; // Fire the event. var e = new BlockEventArgs(b, m, this._in.Source); this._in.Source.Pull.AddSpecialBlock.RotateEvent(e); }
public BlockEventArgs(Block b, Room origin) { this.origin = origin; this.placed = b; this.placer = b.Placer; }