コード例 #1
0
        public void TestInterperitObject()
        {
            JObject o = JObject.Parse("{\"type\" : \"A\", \"time\" : 1000, \"points\" : [ [10.5,23.5], [100.5]] }");
            MovementInterperiter mi = new MovementInterperiter();

            mi.Interperit(o);
        }
コード例 #2
0
        private Wave Parse(JToken obj)
        {
            string   type                 = obj["type"].ToString();
            int      health               = obj["health"].ToObject <int>();
            int      startTime            = obj["startTime"].ToObject <int>();
            int      spawnCount           = obj["spawnCount"].ToObject <int>();
            double   spawnInterval        = obj["interval"].ToObject <double>();
            float    delay                = obj["shootingPattern"]["delay"].ToObject <float>();
            Movement movement             = moveInterpereter.Interperit(obj["movement"]);
            BulletSpawnerInterpereter bsi = new BulletSpawnerInterpereter(movement);
            var pattern = bsi.Interperet(obj["shootingPattern"]);

            return(new Wave(new EnemyFactory(enemies, this.bulletSpawners, pattern, EnemySpriteFactory.Create(type), movement, health, delay), spawnInterval, spawnCount, startTime));
        }