コード例 #1
0
        public MultiComponentList(GenericReader reader)
        {
            _ = reader.ReadInt();

            m_Min    = reader.ReadPoint2D();
            m_Max    = reader.ReadPoint2D();
            m_Center = reader.ReadPoint2D();
            Width    = reader.ReadInt();
            Height   = reader.ReadInt();

            int length = reader.ReadInt();

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

            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[Width][];
            Tiles = new StaticTile[Width][][];

            for (int x = 0; x < Width; ++x)
            {
                tiles[x] = new TileList[Height];
                Tiles[x] = new StaticTile[Height][];

                for (int y = 0; y < 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(allTiles[i].m_ItemID, (sbyte)allTiles[i].m_OffsetZ);
                }
            }

            for (int x = 0; x < Width; ++x)
            {
                for (int y = 0; y < Height; ++y)
                {
                    Tiles[x][y] = tiles[x][y].ToArray();
                }
            }
        }
コード例 #2
0
ファイル: Coords.cs プロジェクト: zerodowned/Core
        public void Deserialize(GenericReader reader)
        {
            _Map   = reader.ReadMap();
            _Point = reader.ReadPoint2D();

            Compute();
        }
コード例 #3
0
		public MahjongWallBreakIndicator( MahjongGame game, GenericReader reader )
		{
			m_Game = game;

			int version = reader.ReadInt();

			m_Position = reader.ReadPoint2D();
		}
コード例 #4
0
		public MahjongDealerIndicator( MahjongGame game, GenericReader reader )
		{
			m_Game = game;

			int version = reader.ReadInt();

			m_Position = reader.ReadPoint2D();
			m_Direction = (MahjongPieceDirection) reader.ReadInt();
			m_Wind = (MahjongWind) reader.ReadInt();
		}
コード例 #5
0
        public MahjongTile( MahjongGame game, GenericReader reader )
        {
            m_Game = game;

            int version = reader.ReadInt();

            m_Number = reader.ReadInt();
            m_Value = (MahjongTileType) reader.ReadInt();
            m_Position = reader.ReadPoint2D();
            m_StackLevel = reader.ReadInt();
            m_Direction = (MahjongPieceDirection) reader.ReadInt();
            m_Flipped = reader.ReadBool();
        }
コード例 #6
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadEncodedInt();
			Point = reader.ReadPoint2D();
			Range = reader.ReadInt();
			Map = reader.ReadMap();

			int count = reader.ReadInt();
			Messages = new string[ count ];

			for ( int i = 0; i < count; i++ )
				Messages[i] = reader.ReadString();

			OnMessage = reader.ReadInt();
		}	
コード例 #7
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 6:
					{
						m_Addons = reader.ReadItemList();
						goto case 5;
					}
				
				case 5:
					{
						
						m_HasMarket = reader.ReadBool();
						goto case 4;
					}
				
				
				
				case 4:
					{
						m_RegionCoords = ReadRect3DArray(reader);
						goto case 3;
					}
					
					
				case 3:
					{
						m_votingstone = (CityVotingStone)reader.ReadItem();
						m_AssistMayor = reader.ReadMobile();
						goto case 2;
					}
					
					
				case 2:
					{
						m_resstone = (CityResurrectionStone)reader.ReadItem();
						goto case 1;
					}
					
				case 1: // City Resurrection Stone Update
					{
						m_ResFee = reader.ReadInt();
						m_CorpseFee = reader.ReadInt();
						goto case 0;
					}
				case 0: // Beta Release
					{
						m_Time = reader.ReadDeltaTime();
						m_Mayor = reader.ReadMobile();
						m_Coords = ReadRect2DArray( reader );
						m_IsGuarded = reader.ReadBool();
						m_AllowHouses = reader.ReadBool();
						m_Level = reader.ReadInt();
						m_CityName = reader.ReadString();
						m_toDelete = reader.ReadItemList();
						m_Members = reader.ReadMobileList();
						m_TravelTax = reader.ReadInt();
						m_IncomeTax = reader.ReadInt();
						m_HousingTax = reader.ReadInt();
						m_CityTreasury = reader.ReadInt();
						m_CityRules = reader.ReadString();
						m_CityWebURL = reader.ReadString();
						m_Center = reader.ReadPoint2D();
						m_MoongateLocation = reader.ReadPoint3D();
						m_Sponsored = reader.ReadMobileList();
						m_isLockedDown = reader.ReadItemList();
						m_MaxDecore = reader.ReadInt();
						m_CurrentDecore = reader.ReadInt();
						m_IsRegistered = reader.ReadBool();
						m_Banned = reader.ReadMobileList();
						m_Waring = reader.ReadItemList();
						m_WarsDeclared = reader.ReadItemList();
						m_WarsInvited = reader.ReadItemList();
						m_Allegiances = reader.ReadItemList();
						m_AllegiancesDeclared = reader.ReadItemList();
						m_AllegiancesInvited = reader.ReadItemList();
						m_HasBank = reader.ReadBool();
						m_HasTavern = reader.ReadBool();
						m_HasHealer = reader.ReadBool();
						m_HasMoongate = reader.ReadBool();
						m_HasStable = reader.ReadBool();
						m_Gardens = reader.ReadItemList();
						m_Parks = reader.ReadItemList();
						m_Vendors = reader.ReadMobileList();
						break;
					}
			}

			m_Timer = new CityUpdateTimer( m_Time, this );
			m_Timer.Start();

			UpdateRegion();
		}
コード例 #8
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			m_Level = (int)reader.ReadInt();
			m_Map = reader.ReadMap();
			m_Location = reader.ReadPoint2D();
		}
コード例 #9
0
ファイル: BaseBoat.cs プロジェクト: Crome696/ServUO
        public BoatCourse(GenericReader reader)
        {
            int version = reader.ReadInt();

            m_GivenMap = reader.ReadBool();

            int c = reader.ReadInt();
            for (int i = 0; i < c; i++)
                m_Waypoints.Add(reader.ReadPoint2D());
        }
コード例 #10
0
ファイル: TreasureMap.cs プロジェクト: Ravenwolfe/xrunuo
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 3:
                case 2:
                case 1:
                    {
                        m_CompletedBy = reader.ReadMobile();

                        goto case 0;
                    }
                case 0:
                    {
                        m_Level = (int) reader.ReadInt();
                        m_Completed = reader.ReadBool();
                        m_Decoder = reader.ReadMobile();
                        m_Map = reader.ReadMap();
                        m_Location = reader.ReadPoint2D();

                        if ( version == 0 && m_Completed )
                            m_CompletedBy = m_Decoder;

                        break;
                    }
            }

            if ( version < 2 )
            {
                if ( m_Level < 1 )
                    m_Level = 1;

                m_Map = GetRandomMap();
                m_Location = GetRandomLocation( m_Map );
            }

            if ( version < 3 )
            {
                ClearPins();
                RecalculateDisplayMap();
            }
        }
コード例 #11
0
ファイル: ToolbarInfo.cs プロジェクト: jasegiffin/JustUO
		private void Deserialize(GenericReader reader)
		{
			int version = reader.ReadInt();

			_Dimensions = new Point2D();
			_Entries = new List<string>();
			_Points = new List<Point3D>();

			switch (version)
			{
				case 0:
					{
						_Font = reader.ReadInt();
						_Phantom = reader.ReadBool();
						_Stealth = reader.ReadBool();
						_Reverse = reader.ReadBool();
						_Lock = reader.ReadBool();

						_Dimensions = reader.ReadPoint2D();

						int count = reader.ReadInt();

						for (int i = 0; i < count; i++)
						{
							_Entries.Add(reader.ReadString());
						}

						_Skin = reader.ReadInt();

						count = reader.ReadInt();

						for (int i = 0; i < count; i++)
						{
							_Points.Add(reader.ReadPoint3D());
						}

						break;
					}
			}
		}
コード例 #12
0
ファイル: MultiData.cs プロジェクト: RedArcaneArcher/ServUO
        public MultiComponentList(GenericReader reader)
        {
            var version = reader.ReadInt();

            m_Min    = reader.ReadPoint2D();
            m_Max    = reader.ReadPoint2D();
            m_Center = reader.ReadPoint2D();
            Width    = reader.ReadInt();
            Height   = reader.ReadInt();

            var length = reader.ReadInt();

            var allTiles = m_List = new MultiTileEntry[length];

            if (version == 0)
            {
                for (var 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 = (TileFlag)reader.ReadUInt();
                }
            }
            else
            {
                for (var 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();

                    if (version > 1)
                    {
                        allTiles[i].m_Flags = (TileFlag)reader.ReadULong();
                    }
                    else
                    {
                        allTiles[i].m_Flags = (TileFlag)reader.ReadUInt();
                    }
                }
            }

            var tiles = new TileList[Width][];

            Tiles = new StaticTile[Width][][];

            for (var x = 0; x < Width; ++x)
            {
                tiles[x] = new TileList[Height];
                Tiles[x] = new StaticTile[Height][];

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

            for (var i = 0; i < allTiles.Length; ++i)
            {
                if (i == 0 || allTiles[i].m_Flags != 0)
                {
                    var xOffset = allTiles[i].m_OffsetX + m_Center.m_X;
                    var yOffset = allTiles[i].m_OffsetY + m_Center.m_Y;
                    var itemID  = (allTiles[i].m_ItemID & TileData.MaxItemValue) | 0x10000;

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

            for (var x = 0; x < Width; ++x)
            {
                for (var y = 0; y < Height; ++y)
                {
                    Tiles[x][y] = tiles[x][y].ToArray();
                }
            }
        }
コード例 #13
0
        public MultiComponentList(GenericReader reader)
        {
            int num3;
            int num4;
            int num5;
            int num6;
            int num7;
            int num8;
            int num9;
            int num10;

            MultiTileEntry[] entryArray2;
            int num11 = reader.ReadInt();

            if (num11 != 0)
            {
                return;
            }
            this.m_Min    = reader.ReadPoint2D();
            this.m_Max    = reader.ReadPoint2D();
            this.m_Center = reader.ReadPoint2D();
            this.m_Width  = reader.ReadInt();
            this.m_Height = reader.ReadInt();
            int num2 = reader.ReadInt();

            this.m_List = (entryArray2 = new MultiTileEntry[num2]);
            MultiTileEntry[] entryArray1 = entryArray2;
            for (num3 = 0; (num3 < num2); ++num3)
            {
                entryArray1[num3].m_ItemID  = reader.ReadShort();
                entryArray1[num3].m_OffsetX = reader.ReadShort();
                entryArray1[num3].m_OffsetY = reader.ReadShort();
                entryArray1[num3].m_OffsetZ = reader.ReadShort();
                entryArray1[num3].m_Flags   = reader.ReadInt();
            }
            TileList[][] listArrayArray1 = new TileList[this.m_Width][];
            this.m_Tiles = new Tile[this.m_Width][][];
            for (num4 = 0; (num4 < this.m_Width); ++num4)
            {
                listArrayArray1[num4] = new TileList[this.m_Height];
                this.m_Tiles[num4]    = new Tile[this.m_Height][];
                for (num5 = 0; (num5 < this.m_Height); ++num5)
                {
                    listArrayArray1[num4][num5] = new TileList();
                }
            }
            for (num6 = 0; (num6 < entryArray1.Length); ++num6)
            {
                if ((num6 == 0) || (entryArray1[num6].m_Flags != 0))
                {
                    num7 = (entryArray1[num6].m_OffsetX + this.m_Center.m_X);
                    num8 = (entryArray1[num6].m_OffsetY + this.m_Center.m_Y);
                    listArrayArray1[num7][num8].Add(((short)((entryArray1[num6].m_ItemID & 16383) | 16384)), ((sbyte)entryArray1[num6].m_OffsetZ));
                }
            }
            for (num9 = 0; (num9 < this.m_Width); ++num9)
            {
                for (num10 = 0; (num10 < this.m_Height); ++num10)
                {
                    this.m_Tiles[num9][num10] = listArrayArray1[num9][num10].ToArray();
                }
            }
        }
コード例 #14
0
ファイル: MultiData.cs プロジェクト: Godkong/Origins
        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();
        }
コード例 #15
0
ファイル: Arena.cs プロジェクト: greeduomacro/cov-shard-svn-1
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    m_Running = reader.ReadBool();
                    m_X1Y1 = reader.ReadPoint2D();
                    m_X2Y2 = reader.ReadPoint2D();
                    m_StartPointPlayer = reader.ReadPoint3D();
                    m_StartPointOpponent = reader.ReadPoint3D();
                    m_ExpelPoint = reader.ReadPoint3D();
                    m_ScoreTable = new Hashtable();
                    int len = reader.ReadInt();
                    for (int i = 0; i < len; i++)
                        m_ScoreTable.Add(reader.ReadMobile(), reader.ReadInt());
                    m_UsersInLine = new List<Mobile>();
                    m_ManageTimer = new ManageTimer(this);
                    break;
            }

            if (m_UsersInLine == null)
                m_UsersInLine = new List<Mobile>();
        }
コード例 #16
0
ファイル: MultiData.cs プロジェクト: PepeBiondi/runsa
		public MultiComponentList( GenericReader reader )
		{
			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					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];

					for ( int i = 0; i < length; ++i )
					{
						allTiles[i].m_ItemID = reader.ReadShort();
						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 Tile[m_Width][][];

					for ( int x = 0; x < m_Width; ++x )
					{
						tiles[x] = new TileList[m_Height];
						m_Tiles[x] = new Tile[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 SA
							// Note #1 | 0x8000 produces problems, namely the server doesn't increase your Z when climbing stairs thus the itemid isn't reconized properly.
							tiles[xOffset][yOffset].Add( (short)((allTiles[i].m_ItemID & 0x7FFF) | 0x4000), (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();

					break;
				}
			}
		}
コード例 #17
0
			public DaviesDeedEntry( GenericReader reader )
			{
				int version = reader.ReadByte();
				m_type = reader.ReadInt(); 
				m_Level = reader.ReadInt();
				m_Decoder = reader.ReadMobile();
				m_Map = reader.ReadMap();
				m_Location2d = reader.ReadPoint2D();
				m_Location3d = reader.ReadPoint3D();
				m_Bounds = reader.ReadRect2D();
				m_Mapnumber = reader.ReadString(); 
			}
コード例 #18
0
ファイル: MultiData.cs プロジェクト: dpisanu/xrunuo
        public MultiComponentList(GenericReader reader)
        {
            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            case 0:
            {
                m_Min  = reader.ReadPoint2D();
                m_Max  = reader.ReadPoint2D();
                Center = reader.ReadPoint2D();
                Width  = reader.ReadInt();
                Height = reader.ReadInt();

                int length = reader.ReadInt();

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

                for (int i = 0; i < length; ++i)
                {
                    ushort id = reader.ReadUShort();

                    if (version == 0 && id >= 0x8000)
                    {
                        id -= 0x8000;
                    }

                    allTiles[i].m_ItemID  = 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();
                }

                TileList[][] tiles = new TileList[Width][];
                Tiles = new Tile[Width][][];

                for (int x = 0; x < Width; ++x)
                {
                    tiles[x] = new TileList[Height];
                    Tiles[x] = new Tile[Height][];

                    for (int y = 0; y < 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 + Center.X;
                        int yOffset = allTiles[i].m_OffsetY + Center.Y;

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

                for (int x = 0; x < Width; ++x)
                {
                    for (int y = 0; y < Height; ++y)
                    {
                        Tiles[x][y] = tiles[x][y].ToArray();
                    }
                }

                break;
            }
            }
        }
コード例 #19
0
        public MultiComponentList(GenericReader reader)
        {
            int version = reader.ReadInt();

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

            int length = reader.ReadInt();

            MultiTileEntry[] allTiles = this.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[this.m_Width][];
            this.m_Tiles = new StaticTile[this.m_Width][][];

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

                for (int y = 0; y < this.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 + this.m_Center.m_X;
                    int yOffset = allTiles[i].m_OffsetY + this.m_Center.m_Y;

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

            for (int x = 0; x < this.m_Width; ++x)
            {
                for (int y = 0; y < this.m_Height; ++y)
                {
                    this.m_Tiles[x][y] = tiles[x][y].ToArray();
                }
            }
        }
コード例 #20
0
ファイル: MapItem.cs プロジェクト: Crome696/ServUO
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
                case 1:
                    {
                        m_Facet = reader.ReadMap();
                        goto case 0;
                    }
				case 0:
				{
					m_Bounds = reader.ReadRect2D();

					m_Width = reader.ReadInt();
					m_Height = reader.ReadInt();

					m_Protected = reader.ReadBool();

					int count = reader.ReadInt();
					for ( int i = 0; i < count; i++ )
						m_Pins.Add( reader.ReadPoint2D() );

					break;
				}
			}
		}
コード例 #21
0
        public MultiComponentList(GenericReader reader)
        {
            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                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];

                for (int i = 0; i < length; ++i)
                {
                    allTiles[i].m_ItemID  = reader.ReadShort();
                    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 Tile[m_Width][][];

                for (int x = 0; x < m_Width; ++x)
                {
                    tiles[x]   = new TileList[m_Height];
                    m_Tiles[x] = new Tile[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((short)((allTiles[i].m_ItemID & 0x3FFF) | 0x4000), (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();
                    }
                }

                break;
            }
            }
        }
コード例 #22
0
ファイル: TreasureMessage.cs プロジェクト: greeduomacro/annox
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 1:
                    {
                        goto case 0;
                    }
                case 0:
                    {
                        m_Level = (int)reader.ReadInt();
                        m_Map = reader.ReadMap();
                        m_Location = reader.ReadPoint2D();

                        //					if ( version == 0 && m_Completed )
                        //						m_CompletedBy = m_Decoder;

                        break;
                    }
            }
        }
コード例 #23
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			
			int version = reader.ReadInt();
			
			_ChestLocation = reader.ReadPoint2D();
			_ChestMap = reader.ReadMap();
			_Decoder = reader.ReadMobile();
			_Level = reader.ReadInt();
			_Bounds = reader.ReadRect2D();
		}
コード例 #24
0
ファイル: Teleporter.cs プロジェクト: zerodowned/angelisland
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 7:
				{
					m_AccessLevel = (AccessLevel)reader.ReadInt();
					goto case 6;
				}
				case 6:
				{
					m_TransportPets = reader.ReadBool();
					m_PetMessage = reader.ReadString();
					goto case 5;
				}
	
				case 5:
				{
					m_PointDest2 = reader.ReadPoint3D();
					m_PointDest3 = reader.ReadPoint3D();
					m_PointDest4 = reader.ReadPoint3D();
					m_PointDest5 = reader.ReadPoint3D();
					m_RectStart = reader.ReadPoint2D();
					m_RectEnd = reader.ReadPoint2D();

					goto case 4;
				}

				case 4:
				{
					m_Criminal = reader.ReadBool();

					goto case 3;
				}

				case 3:
				{
					m_DelayMessage = reader.ReadString();
					m_SparkleEffect = reader.ReadBool();

					goto case 2;
				}

				case 2:
				{
					m_SourceEffect = reader.ReadBool();
					m_DestEffect = reader.ReadBool();
					m_Delay = reader.ReadTimeSpan();
					m_SoundID = reader.ReadEncodedInt();

					goto case 1;
				}
				case 1:
				{
					m_Creatures = reader.ReadBool();

					goto case 0;
				}
				case 0:
				{
					m_Active = reader.ReadBool();
					m_PointDest = reader.ReadPoint3D();
					m_MapDest = reader.ReadMap();

					break;
				}
			}
			
			if (version < 7)
			{
				m_AccessLevel = AccessLevel.Player;
			}

			if ( version < 6)
			{
				m_TransportPets = true;
				m_PetMessage = null;
						
			}
			
		}
コード例 #25
0
ファイル: TreasureMap.cs プロジェクト: zerodowned/angelisland
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
 				{
 				m_Themed = reader.ReadBool();
 				m_type = (ChestThemeType)reader.ReadInt();
 				goto case 0;
 				}
	
				case 0:
				{
					m_Level = (int)reader.ReadInt();
					m_Completed = reader.ReadBool();
					m_Decoder = reader.ReadMobile();
					m_Map = reader.ReadMap();
					m_Location = reader.ReadPoint2D();

					break;
				}
			}
			if ( version < 1)
			{
 			m_Themed = false;
 			m_type = ChestThemeType.None;
 			}
		}
コード例 #26
0
ファイル: HarvestMap.cs プロジェクト: Crome696/ServUO
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            Resource = (CraftResource)reader.ReadInt();
            Expires = reader.ReadDateTime();
            UsesRemaining = reader.ReadInt();

            Target = reader.ReadPoint2D();
            TargetMap = reader.ReadMap();

            if (Expires < DateTime.UtcNow)
                Decay();
            else
                m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), CheckDecay);
        }
コード例 #27
0
ファイル: TreasureMap.cs プロジェクト: Leorgrium/runuo
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				{
					m_CompletedBy = reader.ReadMobile();

					goto case 0;
				}
				case 0:
				{
					m_Level = (int)reader.ReadInt();
					m_Completed = reader.ReadBool();
					m_Decoder = reader.ReadMobile();
					m_Map = reader.ReadMap();
					m_Location = reader.ReadPoint2D();

					if ( version == 0 && m_Completed )
						m_CompletedBy = m_Decoder;

					break;
				}
			}

			if ( Core.AOS && m_Decoder != null && LootType == LootType.Regular)
				LootType = LootType.Blessed;
		}
コード例 #28
0
ファイル: MultiData.cs プロジェクト: Crome696/ServUO
		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();
				}
			}
		}
コード例 #29
0
ファイル: MultiData.cs プロジェクト: pallop/Servuo
        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();
                }
            }
        }
コード例 #30
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    {
                        m_Addon = (BaseBuilding)reader.ReadItem();
                        m_Offset = reader.ReadPoint2D();
                        break;
                    }
            }
        }
コード例 #31
0
ファイル: MultiData.cs プロジェクト: notsentient/RunZHA
        public MultiComponentList( GenericReader reader )
        {
            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    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];

                    for ( int i = 0; i < length; ++i )
                    {
                        allTiles[i].m_ItemID = reader.ReadShort();
                        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 Tile[m_Width][][];

                    for ( int x = 0; x < m_Width; ++x )
                    {
                        tiles[x] = new TileList[m_Height];
                        m_Tiles[x] = new Tile[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( (short)((allTiles[i].m_ItemID & 0x3FFF) | 0x4000), (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();

                    break;
                }
            }
        }
コード例 #32
0
		public TMapBookEntry( GenericReader reader )
		{
			int version = reader.ReadByte();
			m_Level = reader.ReadInt();
			m_Decoder = reader.ReadMobile();
			m_Map = reader.ReadMap();
			m_Location = reader.ReadPoint2D();
			m_Bounds = reader.ReadRect2D();
		}