當前位置: 首頁>>代碼示例>>C#>>正文


C# GenericReader.ReadUShort方法代碼示例

本文整理匯總了C#中Server.GenericReader.ReadUShort方法的典型用法代碼示例。如果您正苦於以下問題:C# GenericReader.ReadUShort方法的具體用法?C# GenericReader.ReadUShort怎麽用?C# GenericReader.ReadUShort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.GenericReader的用法示例。


在下文中一共展示了GenericReader.ReadUShort方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DesignState

		public DesignState( HouseFoundation foundation, GenericReader reader )
		{
			m_Foundation = foundation;

			int version = reader.ReadInt();

			switch( version )
			{
				case 0:
				{
					m_Components = new MultiComponentList( reader );

					int length = reader.ReadInt();

					m_Fixtures = new MultiTileEntry[length];

					for( int i = 0; i < length; ++i )
					{
						m_Fixtures[i].m_ItemID = reader.ReadUShort();
						m_Fixtures[i].m_OffsetX = reader.ReadShort();
						m_Fixtures[i].m_OffsetY = reader.ReadShort();
						m_Fixtures[i].m_OffsetZ = reader.ReadShort();
						m_Fixtures[i].m_Flags = reader.ReadInt();
					}

					m_Revision = reader.ReadInt();

					break;
				}
			}
		}
開發者ID:jsrn,項目名稱:MidnightWatchServer,代碼行數:31,代碼來源:HouseFoundation.cs

示例2: Skill

        public Skill( Skills owner, SkillInfo info, GenericReader reader )
        {
            m_Owner = owner;
            m_Info = info;

            int version = reader.ReadByte();

            switch ( version )
            {
                case 0:
                {
                    m_Base = reader.ReadUShort();
                    m_Cap = reader.ReadUShort();
                    m_Lock = (SkillLock)reader.ReadByte();

                    break;
                }
                case 0xFF:
                {
                    m_Base = 0;
                    m_Cap = 1000;
                    m_Lock = SkillLock.Up;

                    break;
                }
                default:
                {
                    if ( (version & 0xC0) == 0x00 )
                    {
                        if ( (version & 0x1) != 0 )
                            m_Base = reader.ReadUShort();

                        if ( (version & 0x2) != 0 )
                            m_Cap = reader.ReadUShort();
                        else
                            m_Cap = 1000;

                        if ( (version & 0x4) != 0 )
                            m_Lock = (SkillLock)reader.ReadByte();
                    }

                    break;
                }
            }

            if ( m_Lock < SkillLock.Up || m_Lock > SkillLock.Locked )
            {
                Console.WriteLine( "Bad skill lock -> {0}.{1}", owner.Owner, m_Lock );
                m_Lock = SkillLock.Up;
            }
        }
開發者ID:AlcesAlces,項目名稱:UOsmart,代碼行數:51,代碼來源:Skills.cs

示例3: Deserialize

        public static Skill Deserialize( Skills owner, SkillInfo info, GenericReader reader )
        {
            int version = reader.ReadByte();

            ushort m_Base = 0;
            ushort m_Cap = 0;
            SkillLock m_Lock = SkillLock.Up;

            switch ( version )
            {
                case 0:
                {
                    m_Base = reader.ReadUShort();
                    m_Cap = reader.ReadUShort();
                    m_Lock = (SkillLock)reader.ReadByte();

                    break;
                }
                case 0xFF:
                    return null;

                default:
                {
                    if ( (version & 0xC0) == 0x00 )
                    {
                        if ( (version & 0x1) != 0 )
                            m_Base = reader.ReadUShort();

                        if ( (version & 0x2) != 0 )
                            m_Cap = reader.ReadUShort();
                        else
                            m_Cap = 1000;

                        if ( (version & 0x4) != 0 )
                            m_Lock = (SkillLock)reader.ReadByte();
                    }

                    break;
                }
            }

            return new Skill(owner, info, m_Base, m_Cap, m_Lock);
        }
開發者ID:BackupTheBerlios,項目名稱:sunuo-svn,代碼行數:43,代碼來源:Skills.cs

示例4: MultiComponentList

        public MultiComponentList( GenericReader reader )
        {
            int version = reader.ReadInt();

            m_Min = reader.ReadPoint2D();
            m_Max = reader.ReadPoint2D();
            m_Center = reader.ReadPoint2D();
            m_Width = reader.ReadInt();
            m_Height = reader.ReadInt();

            int length = reader.ReadInt();

            MultiTileEntry[] allTiles = m_List = new MultiTileEntry[length];

            if ( version == 0 ) {
                for ( int i = 0; i < length; ++i )
                {
                    int id = reader.ReadShort();
                    if ( id >= 0x4000 )
                        id -= 0x4000;

                    allTiles[i].m_ItemID = (ushort)id;
                    allTiles[i].m_OffsetX = reader.ReadShort();
                    allTiles[i].m_OffsetY = reader.ReadShort();
                    allTiles[i].m_OffsetZ = reader.ReadShort();
                    allTiles[i].m_Flags = reader.ReadInt();
                }
            } else {
                for ( int i = 0; i < length; ++i )
                {
                    allTiles[i].m_ItemID = reader.ReadUShort();
                    allTiles[i].m_OffsetX = reader.ReadShort();
                    allTiles[i].m_OffsetY = reader.ReadShort();
                    allTiles[i].m_OffsetZ = reader.ReadShort();
                    allTiles[i].m_Flags = reader.ReadInt();
                }
            }

            TileList[][] tiles = new TileList[m_Width][];
            m_Tiles = new StaticTile[m_Width][][];

            for ( int x = 0; x < m_Width; ++x )
            {
                tiles[x] = new TileList[m_Height];
                m_Tiles[x] = new StaticTile[m_Height][];

                for ( int y = 0; y < m_Height; ++y )
                    tiles[x][y] = new TileList();
            }

            for ( int i = 0; i < allTiles.Length; ++i )
            {
                if ( i == 0 || allTiles[i].m_Flags != 0 )
                {
                    int xOffset = allTiles[i].m_OffsetX + m_Center.m_X;
                    int yOffset = allTiles[i].m_OffsetY + m_Center.m_Y;

                    tiles[xOffset][yOffset].Add( (ushort)allTiles[i].m_ItemID, (sbyte)allTiles[i].m_OffsetZ );
                }
            }

            for ( int x = 0; x < m_Width; ++x )
                for ( int y = 0; y < m_Height; ++y )
                    m_Tiles[x][y] = tiles[x][y].ToArray();
        }
開發者ID:Godkong,項目名稱:Origins,代碼行數:65,代碼來源:MultiData.cs

示例5: MultiComponentList

		public MultiComponentList(GenericReader reader)
		{
			int version = reader.ReadInt();

			m_Min = reader.ReadPoint2D();
			m_Max = reader.ReadPoint2D();
			m_Center = reader.ReadPoint2D();
			m_Width = reader.ReadInt();
			m_Height = reader.ReadInt();

			int length = reader.ReadInt();

			var allTiles = m_List = new MultiTileEntry[length];

			if (version == 0)
			{
				for (int i = 0; i < length; ++i)
				{
					int id = reader.ReadShort();
					if (id >= 0x4000)
					{
						id -= 0x4000;
					}

					allTiles[i].m_ItemID = (ushort)id;
					allTiles[i].m_OffsetX = reader.ReadShort();
					allTiles[i].m_OffsetY = reader.ReadShort();
					allTiles[i].m_OffsetZ = reader.ReadShort();
					allTiles[i].m_Flags = reader.ReadInt();
				}
			}
			else
			{
				for (int i = 0; i < length; ++i)
				{
					allTiles[i].m_ItemID = reader.ReadUShort();
					allTiles[i].m_OffsetX = reader.ReadShort();
					allTiles[i].m_OffsetY = reader.ReadShort();
					allTiles[i].m_OffsetZ = reader.ReadShort();
					allTiles[i].m_Flags = reader.ReadInt();
				}
			}

			var tiles = new TileList[m_Width][];
			m_Tiles = new StaticTile[m_Width][][];

			for (int x = 0; x < m_Width; ++x)
			{
				tiles[x] = new TileList[m_Height];
				m_Tiles[x] = new StaticTile[m_Height][];

				for (int y = 0; y < m_Height; ++y)
				{
					tiles[x][y] = new TileList();
				}
			}

			for (int i = 0; i < allTiles.Length; ++i)
			{
				if (i == 0 || allTiles[i].m_Flags != 0)
				{
					int xOffset = allTiles[i].m_OffsetX + m_Center.m_X;
					int yOffset = allTiles[i].m_OffsetY + m_Center.m_Y;

					#region Stygian Abyss
					//tiles[xOffset][yOffset].Add( (ushort)allTiles[i].m_ItemID, (sbyte)allTiles[i].m_OffsetZ );
					tiles[xOffset][yOffset].Add(
						(ushort)((allTiles[i].m_ItemID & TileData.MaxItemValue) | 0x10000), (sbyte)allTiles[i].m_OffsetZ);
					#endregion
				}
			}

			for (int x = 0; x < m_Width; ++x)
			{
				for (int y = 0; y < m_Height; ++y)
				{
					m_Tiles[x][y] = tiles[x][y].ToArray();
				}
			}
		}
開發者ID:Crome696,項目名稱:ServUO,代碼行數:80,代碼來源:MultiData.cs

示例6: Skill

        public Skill( Skills owner, SkillInfo info, GenericReader reader )
        {
            m_Owner = owner;
            m_Info = info;

            int version = reader.ReadByte();

            switch ( version )
            {
                case 0:
                {
                    m_Base = reader.ReadUShort();
                    m_Cap = reader.ReadUShort();
                    m_Lock = (SkillLock)reader.ReadByte();

                    break;
                }
                case 0xFF:
                {
                    m_Base = 0;
                    m_Cap = 1000;
                    m_Lock = SkillLock.Up;

                    break;
                }
                default:
                {
                    if ( (version & 0xC0) == 0x00 )
                    {
                        if ( (version & 0x1) != 0 )
                            m_Base = reader.ReadUShort();

                        if ( (version & 0x2) != 0 )
                            m_Cap = reader.ReadUShort();
                        else
                            m_Cap = 1000;

                        if ( (version & 0x4) != 0 )
                            m_Lock = (SkillLock)reader.ReadByte();
                    }

                    break;
                }
            }
        }
開發者ID:BackupTheBerlios,項目名稱:sunuo-svn,代碼行數:45,代碼來源:Skills.cs

示例7: Deserialize

 public override void Deserialize( GenericReader reader )
 {
     base.Deserialize( reader );
     int version = reader.ReadInt();
     m_Code = reader.ReadUShort();
     m_Controller = reader.ReadItem() as LeverPuzzleController;
 }
開發者ID:kamronbatman,項目名稱:Defiance-AOS-Pre-2012,代碼行數:7,代碼來源:LeverPuzzleItems.cs


注:本文中的Server.GenericReader.ReadUShort方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。