コード例 #1
0
        public override void Init(CossinLette game)
        {
            base.Init(game);

            Application.Init();

            Window test = new("Cossin Lette");

            Label lbl = new();

            lbl.Text = "Buonjour";

            test.Add(lbl);

            test.ShowAll();

            if (world == null)
            {
                throw new Exception();
            }

            var level = world
                        .NewEntity()
                        .Replace(new Level {
                Src = "test"
            });

            var camera = world
                         .NewEntity()
                         .Replace(new Camera())
                         .Replace(new Pos());
        }
コード例 #2
0
        public override void Init(CossinLette game)
        {
            base.Init(game);

            if (world == null)
            {
                throw new Exception();
            }

            var init = JsonSerializer.Deserialize <Init>(File.ReadAllText($"Content/init.json"), JsonSerialization.Options);

            if (init == null)
            {
                throw new Exception();
            }

            var level = world
                        .NewEntity()
                        .Replace(new Level {
                Src = init.Level
            });

            var player = world.NewEntity().Replace <Id>("player");

            foreach (var component in init.Player)
            {
                component.Replace(player);
            }
        }
コード例 #3
0
ファイル: State.cs プロジェクト: Dagothig/cossin-lette-sharp
        public virtual void Init(CossinLette game)
        {
            this.game = game;
            world     = new();

            InitSystems(out updateSystems, out drawSystems, out systems);

            drawSystems
            .Inject(game.Batch)
            .Inject(game.Fonts);

            systems
            .Add(updateSystems)
            .Add(drawSystems)
            .Inject(game)
            .Inject(game.Watcher)
            .Inject(game.Step);

            systems.Init();
        }