Beispiel #1
0
        public static IHostBuilder CreateHostBuilder(string[] args)
        {
            // Init all classes here
            string ADMIN_NAME;
            string ADMIN_PASS;
            string INIT_FILE_PATH = null;

            if (args.Length < 2)//default
            {
                ADMIN_NAME = "ADMIN";
                ADMIN_PASS = "******";
                Console.WriteLine("Usage: dotnet build <username> <password>\n" +
                                  "Please specify Admin name and password next time");
            }
            else
            {
                ADMIN_NAME = args[0];
                ADMIN_PASS = args[1];
                if (args.Length >= 3)
                {
                    Console.WriteLine("using init operations file");
                    INIT_FILE_PATH = args[2];
                }
            }
            Console.WriteLine("Admin Username: {0}\n" +
                              "Admin Password: {1}", ADMIN_NAME, ADMIN_PASS);
            string setup_response = SetUp.Init(ADMIN_NAME, ADMIN_PASS, INIT_FILE_PATH, out NotificationManager notification,
                                               out PurchaseActions purchaseActions, out UserActions userActions, out StoreActions storeActions);

            Console.WriteLine(setup_response);
            if (setup_response.Contains("Invalid operations File"))
            {
                Console.WriteLine(String.Format("Invalid operations File, response from setup = {0}", setup_response));
                Environment.Exit(1);
            }
            Actions.SetUp(purchaseActions, userActions, storeActions, notification);

            return(Host.CreateDefaultBuilder(args)
                   .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseStartup <Startup>();
            }));
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            string gameName = "Grace";

            SetUp.Init();
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.SFMLGraphics.Graphics>(); // need to more to text
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.SFMLInput.Input>();
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.StandardPhysics.Physics>();
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.SFMLSound.SFMLSoundManager>();
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.GraceGame.Core>();

            BlinkByte.Core.Managers.ModuleManager.instance.Init();

            Scene scene = new BlinkByte.Core.Scene();

            GameObject text = GameObject.InstansateNew("Text");

            text.AddComponent <BlinkByte.SFMLGraphics.SFMLTextComp>().SetText("Grace Game");
            scene.addGameObject(text);

            GameObject go = GameObject.InstansateNew("EnemySprite");

            go.AddComponent <BlinkByte.SFMLGraphics.SFMLSprite2DComp>().TextureName = "Enemy.png";
            go.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>();
            (go.getComponent <BlinkByte.Core.Component.Transform>() as BlinkByte.Core.Component.Transform).Position = new Vector2(250, 250);
            go.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(0, 0), new Vector2(64, 64));

            (go.getComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>() as BlinkByte.StandardPhysics.StanRidgedBodyComp).drag = 1;
            (go.getComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>() as BlinkByte.StandardPhysics.StanRidgedBodyComp).SetVelocity(new Vector2(0.1f, 0.2f));

            scene.addGameObject(go);


            GameObject sp = GameObject.InstansateNew("Sprite");

            sp.AddComponent <BlinkByte.SFMLGraphics.SFMLSprite2DComp>().TextureName = "Player.png";
            sp.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>();
            (sp.getComponent <BlinkByte.Core.Component.Transform>() as BlinkByte.Core.Component.Transform).Position = new Vector2(0, 400);
            sp.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(), new Vector2(64, 64));
            sp.AddComponent <BlinkByte.GraceGame.PurpleComp>();
            scene.addGameObject(sp);

            GameObject wallTop = GameObject.InstansateNew("Top Wall");

            wallTop.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().startCollision = false;
            wallTop.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(0, -10), new Vector2(800, 0));
            scene.addGameObject(wallTop);

            GameObject wallLeft = GameObject.InstansateNew("Left Wall");

            wallLeft.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().startCollision = false;
            wallLeft.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(-10, 0), new Vector2(0, 600));
            scene.addGameObject(wallLeft);

            GameObject wallRight = GameObject.InstansateNew("Right Wall");

            wallRight.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().startCollision = false;
            wallRight.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(800, 0), new Vector2(810, 600));
            scene.addGameObject(wallRight);

            GameObject wallBottom = GameObject.InstansateNew("Bottom Wall");

            wallBottom.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().startCollision = false;
            wallBottom.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(0, 600), new Vector2(800, 610));
            scene.addGameObject(wallBottom);

            scene.saveToFile(gameName + "/Scene");
            BlinkByte.Core.IO.LoadFromFile.saveModules(gameName + "/mods");
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            string gameName = "Lewis";


            SetUp.Init();
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.SFMLGraphics.Graphics>(); // need to more to text
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.SFMLInput.Input>();
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.StandardPhysics.Physics>();
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.SFMLSound.SFMLSoundManager>();
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.LewisGame.Core>();



            //BlinkByte.Core.IO.LoadFromFile.LoadModules("mods");

            BlinkByte.Core.Managers.ModuleManager.instance.Init();

            Scene scene = new BlinkByte.Core.Scene();

            ///GameObject text = GameObject.InstansateNew("Text");
            //  text.AddComponent<BlinkByte.SFMLGraphics.SFMLTextComp>().SetText("YAY");
            //  scene.addGameObject(text);

            GameObject go = GameObject.InstansateNew("GameObject");

            (go.AddComponent <BlinkByte.SFMLGraphics.SFMLCircle2DComp>().changeColor(new BlinkByte.Graphics.Colour(255, 0, 0)) as BlinkByte.SFMLGraphics.SFMLCircle2DComp).radius = 50;
            (go.getComponent <BlinkByte.Core.Component.Transform>() as BlinkByte.Core.Component.Transform).Position = new Vector2(250, 250);
            go.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(0, 0), new Vector2(100, 100));

            go.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>();
            go.AddComponent <BlinkByte.LewisGame.GameComp>();


            scene.addGameObject(go);

            GameObject bm = GameObject.InstansateNew("background");

            bm.AddComponent <BlinkByte.SFMLSound.SFMLSoundComp>().setFileName("Audios/toot.wav");
            (bm.AddComponent <BlinkByte.SFMLGraphics.SFMLCircle2DComp>().changeColor(new BlinkByte.Graphics.Colour(0, 255, 0)) as BlinkByte.SFMLGraphics.SFMLCircle2DComp).radius = 50;
            (bm.getComponent <BlinkByte.Core.Component.Transform>() as BlinkByte.Core.Component.Transform).Position = new Vector2(50, 50);
            bm.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(0, 0), new Vector2(100, 100));
            bm.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>();
            scene.addGameObject(bm);

            GameObject bc = GameObject.InstansateNew("ballcolour");

            (bc.AddComponent <BlinkByte.SFMLGraphics.SFMLCircle2DComp>().changeColor(new BlinkByte.Graphics.Colour(0, 125, 125)) as BlinkByte.SFMLGraphics.SFMLCircle2DComp).radius = 50;
            (bc.getComponent <BlinkByte.Core.Component.Transform>() as BlinkByte.Core.Component.Transform).Position = new Vector2(550, 50);
            bc.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(0, 0), new Vector2(100, 100));
            bc.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>();


            scene.addGameObject(bc);
            ;

            GameObject wallTop = GameObject.InstansateNew("Top Wall");

            wallTop.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().startCollision = false;
            wallTop.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(0, -10), new Vector2(800, 0));
            scene.addGameObject(wallTop);

            GameObject wallLeft = GameObject.InstansateNew("Left Wall");

            wallLeft.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().startCollision = false;
            wallLeft.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(-10, 0), new Vector2(0, 600));
            scene.addGameObject(wallLeft);

            GameObject wallRight = GameObject.InstansateNew("Right Wall");

            wallRight.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().startCollision = false;
            wallRight.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(800, 0), new Vector2(800, 600));
            scene.addGameObject(wallRight);

            GameObject wallBottom = GameObject.InstansateNew("Bottom Wall");

            wallBottom.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().startCollision = false;
            wallBottom.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(0, 600), new Vector2(800, 600));
            scene.addGameObject(wallBottom);

            scene.saveToFile(gameName + "/Scene");
            BlinkByte.Core.IO.LoadFromFile.saveModules(gameName + "/mods");
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            string gameName = "James";


            SetUp.Init();
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.SFMLGraphics.Graphics>(); // need to more to text
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.SFMLInput.Input>();
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.StandardPhysics.Physics>();
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.SFMLSound.SFMLSoundManager>();
            BlinkByte.Core.Managers.ModuleManager.instance.AddManager <BlinkByte.JamesGame.Core>();

            BlinkByte.Core.Managers.ModuleManager.instance.Init();

            Scene scene = new BlinkByte.Core.Scene();

            GameObject text = GameObject.InstansateNew("Text");

            text.AddComponent <BlinkByte.SFMLGraphics.SFMLTextComp>().SetText("James Game");
            scene.addGameObject(text);

            GameObject go = GameObject.InstansateNew("GameObject");

            (go.AddComponent <BlinkByte.SFMLGraphics.SFMLCircle2DComp>().changeColor(new BlinkByte.Graphics.Colour(255, 0, 0)) as BlinkByte.SFMLGraphics.SFMLCircle2DComp).radius = 50;
            (go.getComponent <BlinkByte.Core.Component.Transform>() as BlinkByte.Core.Component.Transform).Position = new Vector2(250, 250);
            go.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(0, 0), new Vector2(100, 100));
            go.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().isTrigger = true;
            //go.AddComponent<BlinkByte.Physics.GravityComp>();
            scene.addGameObject(go);


            GameObject sp = GameObject.InstansateNew("Sprite");

            sp.AddComponent <BlinkByte.SFMLGraphics.SFMLSprite2DComp>().TextureName = "DinoTorq.png";
            sp.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>();
            (sp.getComponent <BlinkByte.Core.Component.Transform>() as BlinkByte.Core.Component.Transform).Position = new Vector2(0, 400);
            (sp.getComponent <BlinkByte.Core.Component.Transform>() as BlinkByte.Core.Component.Transform).Scale    = new Vector2(0.25f, 0.25f);
            sp.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(), new Vector2(75, 100));
            sp.AddComponent <BlinkByte.JamesGame.DinoComp>();
            scene.addGameObject(sp);

            GameObject wallTop = GameObject.InstansateNew("Top Wall");

            wallTop.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().startCollision = false;
            wallTop.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(0, -10), new Vector2(800, 0));
            // scene.addGameObject(wallTop);

            GameObject wallLeft = GameObject.InstansateNew("Left Wall");

            wallLeft.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().startCollision = false;
            wallLeft.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(-10, 0), new Vector2(0, 600));
            // scene.addGameObject(wallLeft);

            GameObject wallRight = GameObject.InstansateNew("Right Wall");

            wallRight.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().startCollision = false;
            wallRight.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(800, 0), new Vector2(810, 600));
            // scene.addGameObject(wallRight);

            GameObject wallBottom = GameObject.InstansateNew("Bottom Wall");

            wallBottom.AddComponent <BlinkByte.StandardPhysics.StanRidgedBodyComp>().startCollision = false;
            wallBottom.AddComponent <BlinkByte.StandardPhysics.StanBoundingBox>().SetMinMax(new Vector2(0, 600), new Vector2(800, 610));
            //scene.addGameObject(wallBottom);

            scene.saveToFile(gameName + "/Scene");
            BlinkByte.Core.IO.LoadFromFile.saveModules(gameName + "/mods");
        }