Ejemplo n.º 1
0
 internal static LastGameInfo Load(IkonComposite ikstonData)
 {
     return(new LastGameInfo
     {
         StartConditions = ikstonData.ToOrDefault(StartingConditionsKey, x => StartingConditions.Load(x.To <IkonComposite>()), null),
         PlayersConfig = ikstonData.ToOrDefault(PlayersKey, x => x.To <IkonComposite[]>(), null),
         StarPositionerConfig = ikstonData.ToOrDefault(StarPositionerKey, x => x.To <IkonArray>(), null),
         StarConnectorConfig = ikstonData.ToOrDefault(StarConnectorKey, x => x.To <IkonArray>(), null),
         StarPopulatorConfig = ikstonData.ToOrDefault(StarPopulatorKey, x => x.To <IkonArray>(), null)
     });
 }
Ejemplo n.º 2
0
        internal static LastGameInfo Load(IkonComposite ikstonData)
        {
            var conditions = ikstonData.ToOrDefault(StartingConditionsKey, x => StartingConditions.Load(x.To <IkonComposite>()), null);

            if (conditions == null)
            {
                return(new LastGameInfo());
            }

            var info = new LastGameInfo
            {
                StartConditions      = conditions,
                StarPositionerConfig = ikstonData.ToOrDefault(StarPositionerKey, x => x.To <IkonArray>(), null),
                StarConnectorConfig  = ikstonData.ToOrDefault(StarConnectorKey, x => x.To <IkonArray>(), null),
                StarPopulatorConfig  = ikstonData.ToOrDefault(StarPopulatorKey, x => x.To <IkonArray>(), null)
            };

            return(info);
        }