1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "nel/misc/path.h"
22 #include "nel/misc/file.h"
23 #include "nel/misc/smart_ptr.h"
24 #include "nel/misc/command.h"
25 #include "nel/misc/path.h"
27 #include "nel/georges/u_form.h"
28 #include "nel/georges/u_form_elm.h"
29 #include "nel/georges/u_form_loader.h"
30 #include "nel/georges/load_form.h"
38 using namespace NLMISC
;
40 using namespace NLGEORGES
;
45 //-------------------------------------------------------------------------
48 std::map
<CSheetId
,CSheets::CSheet
> CSheets::_Sheets
;
49 bool CSheets::_Initialised
=false;
51 //-------------------------------------------------------------------------
59 std::vector
<std::string
> filters
;
60 filters
.push_back("creature");
61 filters
.push_back("player");
63 loadForm(filters
, "data_shard/ags_test.packed_sheets", _Sheets
);
69 //-------------------------------------------------------------------------
72 void CSheets::display(NLMISC::CLog
*log
)
74 nlassert(_Initialised
);
76 std::map
<CSheetId
,CSheets::CSheet
>::iterator it
;
77 for(it
=_Sheets
.begin();it
!=_Sheets
.end();++it
)
79 log
->displayNL("SHEET:%s Walk:%f Run:%f Radius:%f Height:%f Bounding:%f Type:%s ChatType: %s",(*it
).first
.toString().c_str(),
80 (*it
).second
.WalkSpeed
,
81 (*it
).second
.RunSpeed
,
84 (*it
).second
.BoundingRadius
,
85 // (*it).second.Name.c_str(),
86 (*it
).second
.isNpc
?"NPC": "CREATURE",
87 (std::string()+((*it
).second
.CanChatTP
?"TP ":"")+((*it
).second
.CanChatTrade
?"MERCHANT ":"")+((*it
).second
.CanChatMission
?"MISSION ":"")).c_str()
93 //-------------------------------------------------------------------------
96 const CSheets::CSheet
*CSheets::lookup( CSheetId id
)
98 nlassert(_Initialised
);
100 // setup an iterator and lookup the sheet id in the map
101 std::map
<CSheetId
,CSheets::CSheet
>::iterator it
=_Sheets
.find(id
);
103 // if we found a valid entry return a pointer to the creature record otherwise 0
104 if (it
!=_Sheets
.end())
105 return &((*it
).second
);
110 } //namespace AGS_TEST