src/Application.hh
author terom
Tue, 09 Dec 2008 04:38:32 +0000
changeset 366 f14a61b2a2d1
parent 358 37b18b779ffb
child 389 e74c1820fbd2
permissions -rw-r--r--
improve mkcmake.sh
#ifndef APPLICATION_HH
#define APPLIATION_HH

#include "Engine.hh"
#include "Error.hh"

#include <ClanLib/core.h>
#include <ClanLib/application.h>

class ArgumentError : public Error {
    public:
        ArgumentError (const std::string &message) : Error(message) { }
};

/**
 * Our CL_ClanApplication. Provides our main function, handles argument parsing and interacts with Engine
 */
class Main : public CL_ClanApplication {
    private:
        // arguments
        CL_CommandLine args;
        
        /**
         * --graphics
         */
        bool arg_graphics;

        /**
         * --port
         */
        std::string arg_port;

        /**
         * --server
         */
        bool arg_server;

        /**
         * --connect
         */
        std::string arg_connect;
        
        /**
         * Set the arg_* members
         */
        void parse_args (int argc, char **argv);

    public:
        /**
         * IT BEGAN IN AFRIKA
         */
        virtual int main (int argc, char **argv);
} app;

#endif