Exemple #1
0
        private void Save(SaveWorldParameters saveWorldParameters)
        {
            SaveSpecies savespecies = screen.GetPopulationAsSaveSpecies();
            savespecies.SaveWorldParameters = saveWorldParameters;
            allLikedItems.Add(savespecies);
            SaveHelper.Save("AllSaved", allLikedItems);

            foreach (var species in savespecies.SavedSpecies)
            {
                foreach (var indvd in species)
                {
                    //debugScreen.AddDebugItem("INDVD X", indvd.x.ToString(), ScreenSystem.Debug.DebugFlagType.Important);
                }
            }
        }
Exemple #2
0
 public SaveWorldParameters SaveWorld()
 {
     SaveWorldParameters world = new SaveWorldParameters();
     world.numberOfIndividualsMax = StaticWorldParameters.numberOfIndividualsMax;
     world.neighborhoodRadiusMax = StaticWorldParameters.neighborhoodRadiusMax;
     world.normalSpeedMax = StaticWorldParameters.normalSpeedMax;
     world.maxSpeedMax = StaticWorldParameters.maxSpeedMax;
     world.c1Max = StaticWorldParameters.CohesiveForceMax;
     world.c2Max = StaticWorldParameters.AligningForceMax;
     world.c3Max = StaticWorldParameters.SeperatingForceMax;
     world.c4Max = StaticWorldParameters.ChanceOfRandomSteeringMax;
     world.c5Max = StaticWorldParameters.TendencyOfPaceKeepingMax;
     return world;
 }
Exemple #3
0
        private void SaveSwarm(SaveWorldParameters saveWorldParameters)
        {
#if WINDOWS
            SaveAllSpecies allLikedItems = SaveHelper.Load("AllSaved");
#else

#endif
            if (allLikedItems != null && allLikedItems.Count() >= maxLikedItems)
            {
                //Replacing
                SaveSpecies oldestSpecies = allLikedItems.OrderBy(s => s.CreadtedDt).First();
                allLikedItems.Remove(oldestSpecies);
                Save(saveWorldParameters);
            }

            if (allLikedItems != null && allLikedItems.Count > 0)
            {
                if (allLikedItems.Count == 1)
                {
                    Save(saveWorldParameters);
                }
                else if (allLikedItems.Count == 2)
                {
                    Save(saveWorldParameters);
                }
                else if (allLikedItems.Count == 3)
                {
                    Save(saveWorldParameters);
                }
                else if (allLikedItems.Count == 4)
                {
                    Save(saveWorldParameters);
                }
                else if (allLikedItems.Count == 5)
                {
                    Save(saveWorldParameters);
                }
            }
            else
            {
                Save(saveWorldParameters);
            }
        }