Colobot
CBotDefParam.h
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2016, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsitec.ch; http://colobot.info; http://github.com/colobot
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see http://gnu.org/licenses
18  */
19 
20 #pragma once
21 
22 #include "CBot/CBotToken.h"
23 #include "CBot/CBotStack.h"
24 #include "CBot/CBotUtils.h"
25 
26 namespace CBot
27 {
28 
29 class CBotCStack;
30 class CBotStack;
31 class CBotVar;
32 
36 class CBotDefParam : public CBotLinkedList<CBotDefParam>
37 {
38 public:
39 
43  CBotDefParam();
44 
48  ~CBotDefParam();
49 
56  static CBotDefParam* Compile(CBotToken* &p, CBotCStack* pStack);
57 
64  bool Execute(CBotVar** ppVars, CBotStack* &pj);
65 
71  void RestoreState(CBotStack* &pj, bool bMain);
72 
77  int GetType();
78 
84 
89  std::string GetParamString();
90 
91 private:
93  CBotToken m_token;
95  std::string m_typename;
97  CBotTypResult m_type;
98  long m_nIdent;
99 };
100 
101 } // namespace CBot
int GetType()
GetType.
Definition: CBotDefParam.cpp:169
static CBotDefParam * Compile(CBotToken *&p, CBotCStack *pStack)
Compile Compiles a list of parameters.
Definition: CBotDefParam.cpp:44
The CBotDefParam class A list of parameters.
Definition: CBotDefParam.h:36
The execution stack.
Definition: CBotStack.h:44
bool Execute(CBotVar **ppVars, CBotStack *&pj)
Execute.
Definition: CBotDefParam.cpp:104
void RestoreState(CBotStack *&pj, bool bMain)
RestoreState.
Definition: CBotDefParam.cpp:154
~CBotDefParam()
~CBotDefParam
Definition: CBotDefParam.cpp:39
A CBot variable.
Definition: CBotVar.h:42
CBotTypResult GetTypResult()
GetTypResult.
Definition: CBotDefParam.cpp:175
The CBotCStack class Management of the stack of compilation.
Definition: CBotCStack.h:35
Definition: CBotUtils.h:99
Class to define the complete type of a variable.
Definition: CBotTypResult.h:47
CBot engine.
Definition: CBotCallMethode.cpp:28
CBotDefParam()
CBotDefParam.
Definition: CBotDefParam.cpp:33
Class representing one token of a program.
Definition: CBotToken.h:80
std::string GetParamString()
GetParamString.
Definition: CBotDefParam.cpp:181