コード例 #1
0
ファイル: NPC.cs プロジェクト: rdwoodring/mudadventure
        protected virtual void OnNPCMoved(PlayerMovedEventArgs e)
        {
            EventHandler<PlayerMovedEventArgs> handler = this.NPCMoved;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: rdwoodring/mudadventure
        private void HandlePlayerMoved(object sender, PlayerMovedEventArgs e)
        {
            if( e.X == this.x && e.Y == this.y && e.Z == this.z)
            {
                this.writeToClient(e.Name + " enters the room.\r\n");
            }

            //TODO: add which direction player left in
            if (e.OldX == this.x && e.OldY == this.y && e.OldZ == this.z)
            {
                this.writeToClient(e.Name + " heads " + e.Direction + ".\r\n");
            }
        }