Exemple #1
0
        public static BlitzballPlayer GetPlayerInfo(int playerIndex, BlitzballData blitzData)
        {
            var techs = new byte[5];

            for (int i = 0; i < 5; i++)
            {
                techs[i] = blitzData.TechsEquipped[playerIndex * 5 + i];
            }

            var player = new BlitzballPlayer()
            {
                Level           = blitzData.PlayerLevels[playerIndex],
                Contract        = blitzData.PlayerContracts[playerIndex],
                Experience      = blitzData.PlayerExperience[playerIndex],
                LeagueGoals     = 0, // TODO Implement This
                Salary          = blitzData.PlayerSalary[playerIndex],
                SkillFlags1     = blitzData.AbilityFlags1[playerIndex],
                SkillFlags2     = blitzData.AbilityFlags2[playerIndex],
                TechCapacity    = blitzData.TechsAvailable[playerIndex],
                Techs           = techs,
                TournamentGoals = 0, // TODO Implement This
            };

            return(player);
        }
Exemple #2
0
        public static void WriteBlitzballData(BlitzballData data)
        {
            var dataPtr = Marshal.AllocHGlobal(_blitzDataSize);

            try
            {
                Marshal.StructureToPtr(data, dataPtr, false);
                var dataBytes = new byte[_blitzDataSize];
                Marshal.Copy(dataPtr, dataBytes, 0, _blitzDataSize);
                GameMemory.Write(_dataPointer, dataBytes, false);
            }
            finally
            {
                Marshal.FreeHGlobal(dataPtr);
            }
        }