示例#1
0
        public Player(Pointer playerTarget)
        {
            activePtr = playerTarget.Clone();

            Pointer playerEntity = playerTarget.Adjust(4);

            switch (GameHook.CurrentVersion)
            {
            case GameVersion.TFE: {
                namePtr = playerEntity.AddOffsets(0x310, 0x0);

                startTimeUnixPtr  = playerEntity.AddOffsets(0xAC0);
                levelStartTimePtr = playerEntity.AddOffsets(0xAC8);

                LevelStats = new PlayerStats(playerEntity.AddOffsets(0x1240));
                GameStats  = new PlayerStats(playerEntity.AddOffsets(0x1268));
                break;
            }

            case GameVersion.TSE: {
                namePtr = playerEntity.AddOffsets(0x310, 0x0);

                startTimeUnixPtr  = playerEntity.AddOffsets(0xC38);
                levelStartTimePtr = playerEntity.AddOffsets(0xC40);

                LevelStats = new PlayerStats(playerEntity.AddOffsets(0x2584));
                GameStats  = new PlayerStats(playerEntity.AddOffsets(0x25AC));
                break;
            }

            case GameVersion.REVOLUTION: {
                namePtr = playerEntity.AddOffsets(0x368, 0x0);

                startTimeUnixPtr  = playerEntity.AddOffsets(0xC2C);
                levelStartTimePtr = playerEntity.AddOffsets(0xC34);

                LevelStats = new PlayerStats(playerEntity.AddOffsets(0x2B20));
                GameStats  = new PlayerStats(playerEntity.AddOffsets(0x2B90));
                break;
            }
            }
        }
示例#2
0
		public DataType UnifyPointer(Pointer ptrA, DataType b)
		{
			PrimitiveType pb = b as PrimitiveType;
			if (pb != null)
			{
				if ((ptrA.Size == 0 || pb.Size == 0 || ptrA.Size == pb.Size) &&
					(pb.Domain & Domain.Pointer|Domain.Selector) != 0)
				{
					return ptrA.Clone();
				}
			}
			return MakeUnion(ptrA, b);
		}