Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

treestructure.cpp

00001 /***************************************************************************
00002                             treetructure.cpp  -  description
00003                                 -------------------
00004     begin                : july 23th, 2006
00005     copyright            : (C) 2006 by Duong-Khang NGUYEN
00006     email                : neoneurone @ users sourceforge net
00007     
00008     $Id: treestructure.cpp 63 2006-10-17 20:45:12Z neoneurone $
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *   This program is free software; you can redistribute it and/or modify  *
00014  *   it under the terms of the GNU General Public License as published by  *
00015  *   the Free Software Foundation; either version 2 of the License, or     *
00016  *   any later version.                                                    *
00017  *                                                                         *
00018  ***************************************************************************/
00019 
00020 #include "treestructure.h"
00021 
00022 #include "globalvar.h"
00023 extern GlobalVar gVars;
00024 
00025 
00026    /*=====================================================================*/
00027 TreeStructure::TreeStructure():
00028 Structure()
00029 {
00030     OPENCITY_DEBUG( "ctor" );
00031 }
00032 
00033 
00034    /*=====================================================================*/
00035 TreeStructure::TreeStructure(
00036     const OPENCITY_STRUCTURE_CODE & enumStructCode):
00037 Structure( enumStructCode )
00038 {
00039     OPENCITY_DEBUG( "ctor param" );
00040 
00041     _eGC = OPENCITY_GRAPHIC_CODE(OC_TREE_BEGIN + rand() % (OC_TREE_END - OC_TREE_BEGIN + 1));
00042 //  _eGC = gVars.gpPropertyMgr->GetGC( enumStructCode );
00043     _eType = gVars.gpPropertyMgr->GetST( enumStructCode );
00044 }
00045 
00046 
00047    /*=====================================================================*/
00048 /* not used atm
00049 TreeStructure::TreeStructure(
00050     const OPENCITY_STRUCTURE_CODE & enumStructCode,
00051     Structure * pMain ):
00052 Structure( enumStructCode, pMain )
00053 {
00054     assert( pMain != NULL );
00055 
00056     _eGC = gVars.gpPropertyMgr->GetGC( enumStructCode );
00057     _eType = gVars.gpPropertyMgr->GetST( enumStructCode );
00058 }
00059 */
00060 
00061 
00062    /*=====================================================================*/
00063 TreeStructure::~TreeStructure(){
00064    OPENCITY_DEBUG( "dtor" );
00065 }
00066 
00067 
00068    /*=====================================================================*/
00069 /* not used atm
00070 const OPENCITY_GRAPHIC_CODE
00071 TreeStructure::GetNextLevelGraphicCode() const
00072 {
00073 //  OPENCITY_DEBUG("WARNING: Inside Tree");
00074     if (_uiLevel < OC_STRUCTURE_LEVEL_MAX)
00075         return (OPENCITY_GRAPHIC_CODE)(this->GetBaseGraphicCode() + ((_uiLevel+1) / 10));
00076     else
00077         return _eGC;
00078 }
00079 */
00080 
00081 
00082    /*=====================================================================*/
00083 /* not used atm
00084 const OPENCITY_GRAPHIC_CODE
00085 TreeStructure::GetPreviousLevelGraphicCode() const
00086 {
00087     if (_uiLevel > OC_STRUCTURE_LEVEL_MIN)
00088         return (OPENCITY_GRAPHIC_CODE)(this->GetBaseGraphicCode() + ((_uiLevel-1) / 10));
00089     else
00090         return _eGC;
00091 }
00092 */
00093 
00094 
00095    /*=====================================================================*/
00096 /* not used atm
00097 const bool
00098 TreeStructure::LevelUp()
00099 {
00100     OPENCITY_GRAPHIC_CODE newGC;
00101     
00102     newGC = this->GetNextLevelGraphicCode();
00103 
00104     if (this->Structure::LevelUp() == true) {
00105         _eGC = newGC;
00106         return true;
00107     }
00108     else {
00109         return false;
00110     }
00111 }
00112 */
00113 
00114 
00115    /*=====================================================================*/
00116 /* not used atm
00117 const bool
00118 TreeStructure::LevelDown()
00119 {
00120     OPENCITY_GRAPHIC_CODE newGC;
00121     
00122     newGC = this->GetPreviousLevelGraphicCode();
00123 
00124     if (this->Structure::LevelDown() == true) {
00125         _eGC = newGC;
00126         return true;
00127     }
00128     else {
00129         return false;
00130     }
00131 }
00132 */
00133 
00134 
00135    /*=====================================================================*/
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145 
00146 
00147 
00148 
00149 
00150 
00151 
00152 
00153 
00154 
00155 
00156 
00157 
00158 
00159 
00160 
00161 
00162 
00163 
00164 

Generated on Sat Nov 11 10:21:10 2006 for OpenCity by  doxygen 1.4.2