Linux multi-monitor fullscreen support
[ryzomcore.git] / nel / tools / logic / logic_editor_dll / Condition.h
bloba09463d896154457ed71de6e05d96e1af2eeed7e
1 // Condition.h: interface for the CCondition class.
2 //
3 //////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_CONDITION_H__160ED1FB_6106_4D5D_B298_0C66ED094B4B__INCLUDED_)
6 #define AFX_CONDITION_H__160ED1FB_6106_4D5D_B298_0C66ED094B4B__INCLUDED_
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
12 #include <afxtempl.h>
14 class CConditionNode;
16 namespace NLLOGIC
18 class CLogicConditionNode;
19 class CLogicCondition;
22 typedef CList< CConditionNode*, CConditionNode* > TPtrConditionList;
25 /**
26 * class CConditionNode
28 class CConditionNode
30 public:
31 enum TConditionType
33 NOT =0,
34 COMPARISON,
35 SUB_CONDITION,
37 TERMINATOR,
40 /// constructor
41 inline CConditionNode( CConditionNode *parent = NULL) : m_pParentNode(parent)
43 m_type = TERMINATOR;
44 m_dComparand = 0;
47 /// copy constructor, also copy all sub nodes (and allocate new nodes for them)
48 CConditionNode( const CConditionNode &node);
51 ///destructor
52 ~CConditionNode();
55 /// get the node as a string for display
56 const CString &getNodeAsString() const;
58 inline CConditionNode *getParentNode() { return m_pParentNode; }
60 /// change all the occurences of the 'old' condition into 'newName' (recursive)
61 void changeConditionName( const CString &old, const CString &newName);
63 /// change all the occurences of the 'old' condition into 'newName' (recursive)
64 void conditionDeleted( const CString &name);
67 // attributes
68 public:
69 /// \name condition logic block
70 //@{
71 /// type of the block
72 TConditionType m_type;
74 /// if sub condition block
75 CString m_sConditionName;
77 /// if Comparison :
78 CString m_sVariableName;
79 CString m_sOperator; //in set '<' '>' '<=' >=' '=' '!='
80 double m_dComparand;
81 //@}
83 /// the sub conditions tree
84 TPtrConditionList m_ctSubTree;
86 /// pointer on the 'parent' node, or NULL if this node is a first level node
87 CConditionNode * m_pParentNode;
89 private:
90 mutable CString m_sNodeString;
94 /**
95 * class CCondition
97 class CCondition
99 public:
100 /// constructor
101 CCondition();
103 /// copy constructor
104 CCondition( const CCondition &cond);
106 /// change all the occurences of the 'old' condition into 'newName' (for the nodes)
107 void changeConditionName( CString old, const CString &newName) const;
109 // the specified condition has been deleted, delete all references to it
110 void conditionDeleted( CString name);
112 virtual ~CCondition();
115 // attributes:
116 public:
117 CString m_sName;
119 TPtrConditionList m_ctConditionTree;
125 * cConditionToCLogicCondition
127 void cConditionToCLogicCondition( CCondition& condition, NLLOGIC::CLogicCondition& logicCondition );
130 * cLogicConditionToCCondition
132 void cLogicConditionToCCondition( const NLLOGIC::CLogicCondition& logicCondition, CCondition& condition );
135 #endif // !defined(AFX_CONDITION_H__160ED1FB_6106_4D5D_B298_0C66ED094B4B__INCLUDED_)