GameEngine.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
    void Update()
    {
    }

Usage Example

示例#1
0
        static void Main(string[] args)
        {
            var view = new View();

            try {
                if (args.Length >= 1)
                {
                    ShopLoader sl     = new ShopFileLoader();
                    var        player = new Player();
                    var        ui     = new UserInterface(view);

                    try {
                        Shop shop = sl.load(args[0]);

                        var gm = new GameEngine(player, shop);
                        // Default and first state
                        gm.Push(new MenuState(gm, ui, view));

                        while (gm.Running)
                        {
                            gm.Update();
                        }
                    } catch (ShopLoaderException e) {
                        view.DisplayError($"Error loading shop: {e.Message}");
                    }
                }
                else
                {
                    view.DisplayError("Must pass shop file as a command line argument");
                }
            } catch (Exception e) {
                view.DisplayError($"Unexpected Error: {e.Message}");
                // view.DisplayError(e.StackTrace);
            }
        }
All Usage Examples Of GameEngine::Update