class Attributes
{
  names[] = {"globalPrefix"};
};

class Compile
{
  clearNewLines = 0;
  class Pass_1
  {
    //nodecompile = 1;
    print_0 = "\n/////////////////////////////////////////////////////////////////////////////////\n//\n//ARCADE_FSM_STATES defines\n//\n";
    print_1 = "//{{AFX\n";
    print_2 = "#define ARCADE_FSM_STATES(type,prefix,XX) \\\n";
    //prefix... and presufSAVE/LOAD power demonstration. Other choice is nodecompile = 1;
    presufSAVE = 1;
    prefixSTATE = "";
    sufixSTATE = "";
    prefix2STATE = "";
    sufix2STATE = "";
    indent_1 = 2;
    class State
    {
      print_1 = "\tXX(type, prefix, %(statename)) \\\n";
    };
    indent_2 = 0;
    presufLOAD = 1;
    print_3 = "\n\nDECLARE_DEFINE_ENUM(ArcadeFSMStates, SArcade, ARCADE_FSM_STATES)\n";
    print_4 = "//}}AFX\n\n";
  };
  class Pass_11pokus
  {
    print_0 = "///tohle je jen pokus s preCompile\n";
    print_1 = "%(globalPrefix)\n";
    class State
    {
      print_1 = "%(stateprecondition)";
      class Links
      {
        print_1 = "%(condprecondition)";
      };
    };
  };
  class Pass_2
  {
    print_0 = "/////////////////////////////////////////////////////////////////////////////////\n//\n//State initialization functions\n//\n";
    class State
    {
      hprint_1 = "static void %(statename)(AIGroupContext *context)\n{\n";
      indent_1 = 2;
      print_2 = "%(stateinit)\n";
      indent_2 = 0;
      print_3 = "}\n\n";
    };
    print_1 = "\n";
  };
  class Pass_3
  {
    print_0 = "/////////////////////////////////////////////////////////////////////////////////\n//\n//Condition checking functions\n//\n";
    class State
    {
      hprint_1 = "static void check%(statename)(AIGroupContext *context)\n";
      print_2 = "{\n";
      indent_1 = 2;
      print_3 = "//STATE_PREFIX\n";
      print_4 = "bool _conditionResult = false;\n";
      class Link
      {
        print_1 = "%(condition)\n";
        print_2 = "if (_conditionResult)\n{\n";
        indent_1 = 4;
        print_3 = "%(action)\n";
        hprint_35 = "/*action was:\n%(action)\nend of action*/\n";
        hprint_4 = "context->_fsm->SetState(S%(to), context);\n";
        print_5 = "return;\n";
        indent_2 = 2;
        print_6 = "}\n";
      };
      indent_2 = 0;
      print_5 = "}\n\n";
    };
  };
  class Pass_4
  {
    print_0 = "/////////////////////////////////////////////////////////////////////////////////\n//\n//FSM array definition\n//\n";
    print_1 = "//{{AFX\n";
    print_2 = "static AIGroupFSM::StateInfo arcadeStates[] =\n{\n";
    print_3 = "//}}AFX\n";
    indent_1 = 2;
    class State
    {
//      nodecompile = 1;
      print_1 = "  AIGroupFSM::StateInfo(%qt(statename), Arcade%(statename), CheckArcade%(statename)),\n";
    };
    indent_2 = 0;
    print_4 = "//{{AFX\n";
    print_5 = "};\n";
    print_6 = "//}}AFX\n";
  };
};

class Decompile
{
  process = 1;   //0 for not processing Decompile info
  FSMLeft  = "/*";
  FSMRight = "*/";
  class FSMPrefix
  {
    default = "";
    action = "//}}AFX\n";
    condition = "//}}AFX\n";
    stateprecondition = "//}}AFX\n";
    condprecondition = "//}}AFX\n";
    stateinit = "//}}AFX\n";
    globalprefix = "//}}AFX\n";
    link = "\n";
  };
  class FSMPrefix2
  {
    default = "";
    head = "*/";
    condition = "\n";
    condprecondition = "\n";
    action = "\n";
    stateinit = "\n";
    stateprecondition = "\n";
    globalprefix = "\n";
  };
  class FSMSufix
  {
    default = "";
    compile = "\n";
    head = "//{{AFX\n/*\n";
    state = "//{{AFX\n";
    link = "\n";
    condition = "\n";
    condprecondition = "\n";
    action = "\n";
    stateinit = "\n";
    stateprecondition = "\n";
    globalprefix = "\n";
  };
  class FSMSufix2
  {
    default = "";
    compile = "\n";
    head = "//}}AFX\n";
    state = "//}}AFX\n";
    link = "\n";
    action = "//{{AFX\n";
    condition = "//{{AFX\n";
    condprecondition = "//{{AFX\n";
    stateinit = "//{{AFX\n";
    stateprecondition = "//{{AFX\n";
    globalprefix = "//{{AFX\n";
  };
};

