Пример #1
0
        internal static PlayerData newPlayerData(this MemoryCard memoryCard)
        {
            PlayerData playerData = memoryCard.insert <PlayerData>();

            playerData.botLevel          = 0;
            playerData.deviceName        = "deviceName";
            playerData.maxBotLevel       = 0;
            playerData.maxBotRarity      = 0;
            playerData.maxSpaceshipLevel = 10;
            playerData.modelVersion      = 0;
            playerData.music             = true;
            playerData.name          = "name";
            playerData.points        = 10000;
            playerData.premiumPoints = 256;
            playerData.sound         = true;

            MothershipData mothershipData = memoryCard.newMothershipData();

            playerData.mothership = mothershipData;

            Element.Type[] elementTypes =
            {
                Element.Type.water,
                Element.Type.fire,
                Element.Type.ice,
                Element.Type.wind
            };

            for (int i = 0; i < 4; i++)
            {
                MothershipSlotData mothershipSlotData = memoryCard.newMothershipSlotData();
                mothershipSlotData.index = i;

                SpaceshipData spaceshipData = memoryCard.newSpaceshipData(Spaceship.Rarity.common,
                                                                          Spaceship.randomColorFor(elementTypes[i]));
                mothershipSlotData.spaceship = spaceshipData;
                mothershipData.addToSlots(mothershipSlotData);
            }

            return(playerData);
        }
Пример #2
0
 internal void addToSlots(MothershipSlotData mothershipSlotData)
 {
     mothershipSlotData.parentMothership = this;
 }
Пример #3
0
        internal static MothershipSlotData newMothershipSlotData(this MemoryCard memoryCard)
        {
            MothershipSlotData mothershipSlotData = memoryCard.insert <MothershipSlotData>();

            return(mothershipSlotData);
        }