mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
f405b82ce2
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1201 0fc631ac-6414-0410-93d0-97cfa31319b6
51 lines
1.6 KiB
C++
51 lines
1.6 KiB
C++
//+----------------------------------------------------------------------------+
|
|
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
|
|
//| Copyright: (C) 2001 - 2008 Twan van Laarhoven and "coppro" |
|
|
//| License: GNU General Public License 2 or later (see file COPYING) |
|
|
//+----------------------------------------------------------------------------+
|
|
|
|
#ifndef HEADER_CLI_MAIN
|
|
#define HEADER_CLI_MAIN
|
|
|
|
// ----------------------------------------------------------------------------- : Includes
|
|
|
|
#include <util/prec.hpp>
|
|
#include <data/set.hpp>
|
|
#include <data/export_template.hpp>
|
|
#include <script/profiler.hpp>
|
|
|
|
// ----------------------------------------------------------------------------- : Command line interface
|
|
|
|
class CLISetInterface : public SetView {
|
|
public:
|
|
/// The set is optional
|
|
CLISetInterface(const SetP& set, bool quiet = false);
|
|
~CLISetInterface();
|
|
protected:
|
|
virtual void onAction(const Action&, bool) {}
|
|
virtual void onChangeSet();
|
|
virtual void onBeforeChangeSet();
|
|
private:
|
|
bool quiet; ///< Supress prompts and other non-vital stuff
|
|
bool running; ///< Still running?
|
|
|
|
void run();
|
|
void showWelcome();
|
|
void showUsage();
|
|
void handleCommand(const String& command);
|
|
#if USE_SCRIPT_PROFILING
|
|
void showProfilingStats(const FunctionProfile& parent, int level = 0);
|
|
#endif
|
|
|
|
/// our own context, when no set is loaded
|
|
Context& getContext();
|
|
Context* our_context;
|
|
size_t scope;
|
|
|
|
// export info, so we can write files
|
|
ExportInfo ei;
|
|
};
|
|
|
|
// ----------------------------------------------------------------------------- : EOF
|
|
#endif
|