Ejemplo n.º 1
0
        public void Save(XmlTextWriter writer)
        {
            writer.WriteElementString("plots", Plots.ToString());
            writer.WriteElementString("travelTime", TravelTime.ToString());
            writer.WriteElementString("foodRate", FoodRate.ToString());
            writer.WriteElementString("gameSeconds", GameSeconds.ToString());

            if (PlotProbabilities.Count > 0)
            {
                writer.WriteStartElement("plot-probabilities");

                foreach (var probabilitySet in PlotProbabilities)
                {
                    writer.WriteElementString("probability-set", CLIObject.ToArrayString(probabilitySet));
                }

                // plot-probabilities
                writer.WriteEndElement();
            }

            if (ProbabilityShiftTimes.Count > 0)
            {
                writer.WriteElementString("probability-shift-times", CLIObject.ToArrayString(ProbabilityShiftTimes));
            }
        }
Ejemplo n.º 2
0
        public IDictionary <string, string> GetArguments()
        {
            var arguments = new Dictionary <string, string>();

            arguments["plots"]                   = Plots.ToString();
            arguments["travel-time"]             = TravelTime.ToString();
            arguments["food-rate"]               = FoodRate.ToString();
            arguments["game-duration"]           = GameSeconds.ToString();
            arguments["plot-probabilities"]      = CLIObject.ToMultiArrayString(PlotProbabilities.Cast <IEnumerable <int> >());
            arguments["probability-shift-times"] = CLIObject.ToArrayString(ProbabilityShiftTimes);

            return(arguments);
        }