From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- docs/doxygen/nel/bool__cond_8cpp-source.html | 190 +++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 docs/doxygen/nel/bool__cond_8cpp-source.html (limited to 'docs/doxygen/nel/bool__cond_8cpp-source.html') diff --git a/docs/doxygen/nel/bool__cond_8cpp-source.html b/docs/doxygen/nel/bool__cond_8cpp-source.html new file mode 100644 index 00000000..2d83fa63 --- /dev/null +++ b/docs/doxygen/nel/bool__cond_8cpp-source.html @@ -0,0 +1,190 @@ + + + + nevrax.org : docs + + + + + + + + + + + + + + +
# Home   # nevrax.com   
+ + + + +
Nevrax
+ + + + + + + + + + +
+ + +
+ Nevrax.org
+ + + + + + + +
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
+
+ + +
+ + +
+Docs + +
+  + + + + + +
Documentation 
+ +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  
+

bool_cond.cpp

Go to the documentation of this file.
00001 /* Copyright, 2000 Nevrax Ltd.
+00002  *
+00003  * This file is part of NEVRAX <MODULE_NAME>.
+00004  * NEVRAX <MODULE_NAME> is free software; you can redistribute it and/or modify
+00005  * it under the terms of the GNU General Public License as published by
+00006  * the Free Software Foundation; either version 2, or (at your option)
+00007  * any later version.
+00008 
+00009  * NEVRAX <MODULE_NAME> is distributed in the hope that it will be useful, but
+00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
+00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+00012  * General Public License for more details.
+00013 
+00014  * You should have received a copy of the GNU General Public License
+00015  * along with NEVRAX <MODULE_NAME>; see the file COPYING. If not, write to the
+00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+00017  * MA 02111-1307, USA.
+00018  */
+00019 
+00020 #include "nel/ai/logic/bool_cond.h"
+00021 
+00022 namespace NLAILOGIC
+00023 {
+00024         using namespace NLAIAGENT;
+00025         
+00026         IBaseCond::IBaseCond()
+00027         {
+00028         }
+00029 
+00030         IBaseCond::IBaseCond(std::list<IBaseBoolType *> &conds)
+00031         {
+00032                 std::list<IBaseBoolType *>::iterator it_c = conds.begin();
+00033                 while ( it_c != conds.end() )
+00034                 {
+00035                         _Conds.push_back( (IBaseBoolType *) (*it_c)->clone() );
+00036                         it_c++;
+00037                 }
+00038         }
+00039         
+00040         IBaseCond::~IBaseCond()
+00041         {
+00042                 std::list<IBaseBoolType *>::iterator it_c = _Conds.begin();
+00043                 while ( it_c != _Conds.end() )
+00044                 {
+00045                         ( *it_c )->release();
+00046                         it_c++;
+00047                 }
+00048         }
+00049         
+00050         void IBaseCond::addCond(IBaseBoolType *cond)
+00051         {
+00052                 _Conds.push_back( (IBaseBoolType *) cond->clone() );
+00053         }
+00054 
+00055         CondAnd::CondAnd()
+00056         {
+00057         }
+00058         
+00059         CondAnd::CondAnd(std::list<IBaseBoolType *> &conds) : IBaseCond( conds )
+00060         {
+00061         }
+00062 
+00063         float CondAnd::truthValue() const
+00064         {
+00065                 float truth = 1.0;
+00066                 std::list<IBaseBoolType *>::const_iterator it_c = _Conds.begin();
+00067                 while ( it_c != _Conds.end() )
+00068                 {
+00069                         if ( ( *it_c )->truthValue() < truth )
+00070                                 truth = ( *it_c )->truthValue();
+00071                 }
+00072                 return truth;
+00073         };
+00074 
+00075         bool CondAnd::isTrue()
+00076         {
+00077                 std::list<IBaseBoolType *>::iterator it_c = _Conds.begin();
+00078                 while ( it_c != _Conds.end() )
+00079                 {
+00080                         if ( ! ( *it_c )->isTrue() )
+00081                                 return false;
+00082                 }
+00083                 return true;
+00084         }
+00085                 
+00086         CondOr::CondOr()
+00087         {
+00088         }
+00089 
+00090         CondOr::CondOr(std::list<IBaseBoolType *> &conds) : IBaseCond( conds )
+00091         {
+00092         }
+00093         
+00094         float CondOr::truthValue() const
+00095         {
+00096                 float truth = 0.0;
+00097                 std::list<IBaseBoolType *>::const_iterator it_c = _Conds.begin();
+00098                 while ( it_c != _Conds.end() )
+00099                 {
+00100                         if ( ( *it_c )->truthValue() > truth )
+00101                                 truth = ( *it_c )->truthValue();
+00102                 }
+00103                 return truth;
+00104         };
+00105 
+00106         bool CondOr::isTrue()
+00107         {
+00108                 std::list<IBaseBoolType *>::iterator it_c = _Conds.begin();
+00109                 while ( it_c != _Conds.end() )
+00110                 {
+00111                         if ( ! ( *it_c )->isTrue() )
+00112                                 return true;
+00113                 }
+00114                 return false;
+00115         }       
+00116 }
+
+ + +
                                                                                                                                                                    +
+ + -- cgit v1.2.1