Example #1
0
        protected override void UpgradeCore(XElement old_settings, string from_version)
        {
            for (; from_version != Version;)
            {
                switch (from_version)
                {
                case "v1.0":
                {
                    #region SettingsData type moved
                    {
                        Settings_.Child(old_settings, "Consumers")?.SetAttributeValue("ty", "SolarHotWater.Common.SettingsData+Consumer[]");
                        foreach (var elem in Settings_.Children(old_settings, "Consumers", "ControlMode"))
                        {
                            elem.SetAttributeValue("ty", "SolarHotWater.Common.EControlMode");
                        }
                    }
                    #endregion
                    from_version = "v1.01";
                    break;
                }

                default:
                {
                    base.UpgradeCore(old_settings, from_version);
                    return;
                }
                }
            }
        }
Example #2
0
        public MainPage()
        {
            InitializeComponent();

            Settings_.SetSettings(EDificultLevel.Normal);

            UIControls.PropertyBackground = PropertyBackground;
            UIControls.MoodBar            = MoodBar;
            UIControls.ChangesMoodBar     = ChangesMoodBar;
            UIControls.HpBar          = HpBar;
            UIControls.ChangesHpBar   = ChangesHpBar;
            UIControls.FoodBar        = FoodBar;
            UIControls.ChangesFoodBar = ChangesFoodBar;
            UIControls.Page           = this;

            Game = new Game(new User("Jack", new TimeStat(), new Valutes(new UAH(2000000), new USD(5000000)), new BottlesStat(20), new TransportStat(),
                                     new PropertyStat(), new RaitingStat(0), new StatusStat(Enums.EStatus.Homeless), new EducStat(), new MoodStat(50), new HpStat(50), new FoodStat(50)));

            Game.User.TopHead = new ItemsStat(EItemIdentify.TopHead, new Item(EItemIdentify.TopHead, "0000", "дефолт", new BitmapImage(new Uri(System.IO.Path.GetFullPath(@"..\..\Img\StaffsPart\TopHead\Male\TopHead.png")))));
            Game.User.Head    = new ItemsStat(EItemIdentify.Head, new Item(EItemIdentify.Head, "0000", "дефолт", new BitmapImage(new Uri(System.IO.Path.GetFullPath(@"..\..\Img\StaffsPart\Head\Male\Head.png")))));
            Game.User.Tors    = new ItemsStat(EItemIdentify.Tors, new Item(EItemIdentify.Tors, "0000", "дефолт", new BitmapImage(new Uri(System.IO.Path.GetFullPath(@"..\..\Img\StaffsPart\Tors\Male\Tors.png")))));

            Game.User.LeftHand  = new ItemsStat(EItemIdentify.LeftHand, new Item(EItemIdentify.LeftHand, "0000", "дефолт", new BitmapImage(new Uri(System.IO.Path.GetFullPath(@"..\..\Img\StaffsPart\LeftHand\Male\LeftHand.png")))));
            Game.User.RightHand = new ItemsStat(EItemIdentify.RightHand, new Item(EItemIdentify.RightHand, "0000", "дефолт", new BitmapImage(new Uri(System.IO.Path.GetFullPath(@"..\..\Img\StaffsPart\RightHand\Male\RightHand.png")))));

            Game.User.Pants  = new ItemsStat(EItemIdentify.Pants, new Item(EItemIdentify.Pants, "0000", "дефолт", new BitmapImage(new Uri(System.IO.Path.GetFullPath(@"..\..\Img\StaffsPart\Pants\Male\Pants.png")))));
            Game.User.Bottom = new ItemsStat(EItemIdentify.Bottom, new Item(EItemIdentify.Bottom, "0000", "дефолт", new BitmapImage(new Uri(System.IO.Path.GetFullPath(@"..\..\Img\StaffsPart\Bottom\Male\Bottom.png")))));

            this.DataContext = Game;

            ListBox.ItemsSource = Game.User.Bottom.Items;


            SetIEvent();
        }
Example #3
0
        public static dynamic GetTSObject(Settings[] dynArray)
        {
            if (dynArray is null)
            {
                return(null);
            }
            var list = new System.Collections.Generic.List <dynamic>();

            foreach (var dynItem in dynArray)
            {
                list.Add(Settings_.GetTSObject(dynItem));
            }
            return(list.ToArray());
        }
Example #4
0
        public static Settings[] FromTSObject(dynamic[] tsArray)
        {
            if (tsArray is null)
            {
                return(null);
            }
            var list = new System.Collections.Generic.List <Settings>();

            foreach (var tsItem in tsArray)
            {
                list.Add(Settings_.FromTSObject(tsItem));
            }
            return(list.ToArray());
        }