Ejemplo n.º 1
0
        public static GameInterface Initialize(GameDriver driver)
        {
            Log.Message("Initializing: Game Interface");
            var path = DataPath.Get("UI\\GameUI.json");

            return(JsonData.DeserializeFromFile <GameInterface>(path));
        }
Ejemplo n.º 2
0
        public static List <Toy> Perform(GameDriver driver)
        {
            Log.Debug("Loading: Toys");
            var toysFolder = DataPath.Get("Toys");
            var toyFiles   = Directory.GetFiles(toysFolder);

            var toys = new List <Toy>();

            foreach (var toyFile in toyFiles)
            {
                var toy = JsonData.DeserializeFromFile <Toy>(toyFile);
                toy.Active = false;
                toy.Name   = Path.GetFileNameWithoutExtension(toyFile);
                foreach (var damage in toy.DamagePoints)
                {
                    damage.Active = true;
                }

                if (driver.CurrentToy != null && toy.Name == driver.CurrentToy.Name)
                {
                    toy.Active        = true;
                    driver.CurrentToy = toy;
                }

                toys.Add(toy);
            }

            return(toys);
        }
Ejemplo n.º 3
0
        public static DeskClock Perform(GameDriver driver)
        {
            Log.Debug("Loading: Desk Clock");
            var elementsFolder = DataPath.Get("Elements");
            var path           = Path.Combine(elementsFolder, "DeskClock.json");

            return(JsonData.DeserializeFromFile <DeskClock>(path));
        }
Ejemplo n.º 4
0
        public static PaintingKit Perform(GameDriver driver)
        {
            Log.Debug("Loading: Painting Kit");
            var elementsFolder = DataPath.Get("Elements");
            var path           = Path.Combine(elementsFolder, "PaintingKit.json");

            return(JsonData.DeserializeFromFile <PaintingKit>(path));
        }
Ejemplo n.º 5
0
        public static DeskClock Initialize(GameDriver driver)
        {
            var path  = DataPath.Get("Elements\\DeskClock.json");
            var clock = JsonData.DeserializeFromFile <DeskClock>(path);

            clock.Hour   = 8;
            clock.Minute = 0;
            clock.MinuteHandTransform.Angle = 0.0f;
            clock.HourHandTransform.Angle   = 240.0f;
            clock._minuteAngle = 0.0f;
            return(clock);
        }
Ejemplo n.º 6
0
        public TextureBank Initialize(GameDriver driver)
        {
            Log.Message("Initializing: Texture Bank");
            _textures = new Dictionary <string, Texture2D>();

            var pathMapPath = DataPath.Get("TextureBank.json");
            var pathMap     = JsonData.DeserializeFromFile <StringConfiguration>(pathMapPath);

            foreach (var entry in pathMap)
            {
                var texture = driver.Content.Load <Texture2D>(entry.Value);
                _textures.Add(entry.Key, texture);
            }

            return(this);
        }
Ejemplo n.º 7
0
        public static SewingKit Initialize(GameDriver driver)
        {
            var path = DataPath.Get("Elements\\SewingKit.json");

            return(JsonData.DeserializeFromFile <SewingKit>(path));
        }