• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Mahjong.MahjongGame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Server.Engines.Mahjong.MahjongGame的典型用法代码示例。如果您正苦于以下问题:C# MahjongGame类的具体用法?C# MahjongGame怎么用?C# MahjongGame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MahjongGame类属于Server.Engines.Mahjong命名空间,在下文中一共展示了MahjongGame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BuildWalls

        public static void BuildWalls(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGameDealer(state.Mobile))
                return;

            game.ResetWalls(state.Mobile);
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:7,代码来源:MahjongPacketHandlers.cs


示例2: MahjongDealerIndicator

		public MahjongDealerIndicator( MahjongGame game, Point2D position, MahjongPieceDirection direction, MahjongWind wind )
		{
			m_Game = game;
			m_Position = position;
			m_Direction = direction;
			m_Wind = wind;
		}
开发者ID:Godkong,项目名称:RunUO,代码行数:7,代码来源:MahjongDealerIndicator.cs


示例3: MahjongGeneralInfo

        public MahjongGeneralInfo( MahjongGame game )
            : base(0xDA)
        {
            EnsureCapacity( 13 );

            m_Stream.Write( (int) game.Serial );
            m_Stream.Write( (byte) 0 );
            m_Stream.Write( (byte) 0x5 );

            m_Stream.Write( (short) 0 );
            m_Stream.Write( (byte) 0 );

            m_Stream.Write( (byte) ( ( game.ShowScores ? 0x1 : 0x0 ) | ( game.SpectatorVision ? 0x2 : 0x0 ) ) );

            m_Stream.Write( (byte) game.Dices.First );
            m_Stream.Write( (byte) game.Dices.Second );

            m_Stream.Write( (byte) game.DealerIndicator.Wind );
            m_Stream.Write( (short) game.DealerIndicator.Position.Y );
            m_Stream.Write( (short) game.DealerIndicator.Position.X );
            m_Stream.Write( (byte) game.DealerIndicator.Direction );

            m_Stream.Write( (short) game.WallBreakIndicator.Position.Y );
            m_Stream.Write( (short) game.WallBreakIndicator.Position.X );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:25,代码来源:Packets.cs


示例4: MahjongWallBreakIndicator

		public MahjongWallBreakIndicator( MahjongGame game, GenericReader reader )
		{
			m_Game = game;

			int version = reader.ReadInt();

			m_Position = reader.ReadPoint2D();
		}
开发者ID:Godkong,项目名称:Origins,代码行数:8,代码来源:MahjongWallBreakIndicator.cs


示例5: MahjongJoinGame

		public MahjongJoinGame( MahjongGame game ) : base( 0xDA )
		{
			EnsureCapacity( 9 );

			m_Stream.Write( (int) game.Serial );
			m_Stream.Write( (byte) 0 );
			m_Stream.Write( (byte) 0x19 );
		}
开发者ID:Godkong,项目名称:RunUO,代码行数:8,代码来源:Packets.cs


示例6: ExitGame

        public static void ExitGame(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null)
                return;

            Mobile from = state.Mobile;

            game.Players.LeaveGame(from);
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:9,代码来源:MahjongPacketHandlers.cs


示例7: AssignDealer

        public static void AssignDealer(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGameDealer(state.Mobile))
                return;

            int position = pvSrc.ReadByte();

            game.Players.AssignDealer(position);
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:9,代码来源:MahjongPacketHandlers.cs


示例8: MahjongDices

        public MahjongDices( MahjongGame game, GenericReader reader )
        {
            m_Game = game;

            /*int version = */reader.ReadInt();

            m_First = reader.ReadInt();
            m_Second = reader.ReadInt();
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:9,代码来源:MahjongDices.cs


示例9: MahjongDices

        public MahjongDices(MahjongGame game, GenericReader reader)
        {
            this.m_Game = game;

            int version = reader.ReadInt();

            this.m_First = reader.ReadInt();
            this.m_Second = reader.ReadInt();
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:9,代码来源:MahjongDices.cs


示例10: MahjongTile

 public MahjongTile(MahjongGame game, int number, MahjongTileType value, Point2D position, int stackLevel, MahjongPieceDirection direction, bool flipped)
 {
     this.m_Game = game;
     this.m_Number = number;
     this.m_Value = value;
     this.m_Position = position;
     this.m_StackLevel = stackLevel;
     this.m_Direction = direction;
     this.m_Flipped = flipped;
 }
开发者ID:FreeReign,项目名称:forkuo,代码行数:10,代码来源:MahjongTile.cs


示例11: GivePoints

        public static void GivePoints(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGamePlayer(state.Mobile))
                return;

            int to = pvSrc.ReadByte();
            int amount = pvSrc.ReadInt32();

            game.Players.TransferScore(state.Mobile, to, amount);
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:10,代码来源:MahjongPacketHandlers.cs


示例12: MahjongPlayers

        public MahjongPlayers(MahjongGame game, int maxPlayers, int baseScore)
        {
            m_Game = game;
            m_Spectators = new ArrayList();

            m_Players = new Mobile[maxPlayers];
            m_InGame = new bool[maxPlayers];
            m_PublicHand = new bool[maxPlayers];
            m_Scores = new int[maxPlayers];

            for (int i = 0; i < m_Scores.Length; i++)
                m_Scores[i] = baseScore;
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:13,代码来源:MahjongPlayers.cs


示例13: ChangeOption

        public static void ChangeOption(MahjongGame game, NetState state, PacketReader pvSrc)
        {
            if (game == null || !game.Players.IsInGameDealer(state.Mobile))
                return;

            pvSrc.ReadInt16();
            pvSrc.ReadByte();

            int options = pvSrc.ReadByte();

            game.ShowScores = (options & 0x1) != 0;
            game.SpectatorVision = (options & 0x2) != 0;
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:13,代码来源:MahjongPacketHandlers.cs


示例14: MahjongPlayers

        public MahjongPlayers(MahjongGame game, GenericReader reader)
        {
            this.m_Game = game;
            this.m_Spectators = new ArrayList();

            int version = reader.ReadInt();

            int seats = reader.ReadInt();
            this.m_Players = new Mobile[seats];
            this.m_InGame = new bool[seats];
            this.m_PublicHand = new bool[seats];
            this.m_Scores = new int[seats];

            for (int i = 0; i < seats; i++)
            {
                this.m_Players[i] = reader.ReadMobile();
                this.m_PublicHand[i] = reader.ReadBool();
                this.m_Scores[i] = reader.ReadInt();
            }

            this.m_DealerPosition = reader.ReadInt();
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:22,代码来源:MahjongPlayers.cs


示例15: MahjongRelieve

        public MahjongRelieve(MahjongGame game)
            : base(0xDA)
        {
            this.EnsureCapacity(9);

            this.m_Stream.Write((int)game.Serial);
            this.m_Stream.Write((byte)0);
            this.m_Stream.Write((byte)0x1A);
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:9,代码来源:Packets.cs


示例16: MoveDealerIndicator

		public static void MoveDealerIndicator( MahjongGame game, NetState state, PacketReader pvSrc )
		{
			if ( game == null || !game.Players.IsInGameDealer( state.Mobile ) )
				return;

			MahjongPieceDirection direction = GetDirection( pvSrc.ReadByte() );

			MahjongWind wind = GetWind( pvSrc.ReadByte() );

			int y = pvSrc.ReadInt16();
			int x = pvSrc.ReadInt16();

			game.DealerIndicator.Move( new Point2D( x, y ), direction, wind );
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:14,代码来源:MahjongPacketHandlers.cs


示例17: MahjongTilesInfo

		public MahjongTilesInfo( MahjongGame game, Mobile to ) : base( 0xDA )
		{
			MahjongTile[] tiles = game.Tiles;
			MahjongPlayers players = game.Players;

			EnsureCapacity( 11 + 9 * tiles.Length );

			m_Stream.Write( (int) game.Serial );
			m_Stream.Write( (byte) 0 );
			m_Stream.Write( (byte) 0x4 );

			m_Stream.Write( (short) tiles.Length );

			foreach ( MahjongTile tile in tiles )
			{
				m_Stream.Write( (byte) tile.Number );

				if ( tile.Flipped )
				{
					int hand = tile.Dimensions.GetHandArea();

					if ( hand < 0 || players.IsPublic( hand ) || players.GetPlayer( hand ) == to || (game.SpectatorVision && players.IsSpectator( to )) )
						m_Stream.Write( (byte)tile.Value );
					else
						m_Stream.Write( (byte) 0 );
				}
				else
				{
					m_Stream.Write( (byte) 0 );
				}

				m_Stream.Write( (short) tile.Position.Y );
				m_Stream.Write( (short) tile.Position.X );
				m_Stream.Write( (byte) tile.StackLevel );
				m_Stream.Write( (byte) tile.Direction );

				m_Stream.Write( tile.Flipped ? (byte) 0x10 : (byte) 0x0 );
			}
		}
开发者ID:Godkong,项目名称:RunUO,代码行数:39,代码来源:Packets.cs


示例18: TogglePublicHand

		public static void TogglePublicHand( MahjongGame game, NetState state, PacketReader pvSrc )
		{
			if ( game == null || !game.Players.IsInGamePlayer( state.Mobile ) )
				return;

			pvSrc.ReadInt16();
			pvSrc.ReadByte();

			bool publicHand = pvSrc.ReadBoolean();

			game.Players.SetPublic( game.Players.GetPlayerIndex( state.Mobile ), publicHand );
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:12,代码来源:MahjongPacketHandlers.cs


示例19: MoveTile

		public static void MoveTile( MahjongGame game, NetState state, PacketReader pvSrc )
		{
			if ( game == null || !game.Players.IsInGamePlayer( state.Mobile ) )
				return;

			int number = pvSrc.ReadByte();

			if ( number < 0 || number >= game.Tiles.Length )
				return;

			pvSrc.ReadByte(); // Current direction

			MahjongPieceDirection direction = GetDirection( pvSrc.ReadByte() );

			pvSrc.ReadByte();

			bool flip = pvSrc.ReadBoolean();

			pvSrc.ReadInt16(); // Current Y
			pvSrc.ReadInt16(); // Current X

			pvSrc.ReadByte();

			int y = pvSrc.ReadInt16();
			int x = pvSrc.ReadInt16();

			pvSrc.ReadByte();

			game.Tiles[number].Move( new Point2D( x, y ), direction, flip, game.Players.GetPlayerIndex( state.Mobile ) );
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:30,代码来源:MahjongPacketHandlers.cs


示例20: OpenSeat

		public static void OpenSeat( MahjongGame game, NetState state, PacketReader pvSrc )
		{
			if ( game == null || !game.Players.IsInGameDealer( state.Mobile ) )
				return;

			int position = pvSrc.ReadByte();

			if ( game.Players.GetPlayer( position ) == state.Mobile )
				return;

			game.Players.OpenSeat( position );
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:12,代码来源:MahjongPacketHandlers.cs



注:本文中的Server.Engines.Mahjong.MahjongGame类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Reports.PersistanceReader类代码示例发布时间:2022-05-26
下一篇:
C# Help.PageEntry类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap