Add infos into target window
[ryzomcore.git] / ryzom / server / src / entities_game_service / mission_pd.cpp
blob21af9fe3385a3e99619203b429e0e18579a85172
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2015 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "stdpch.h"
22 #include "egs_pd.h"
24 namespace EGSPD
27 /* -----------------------------------------
28 * Static Implementation of CActiveStepStatePD
29 * ----------------------------------------- */
30 uint32 CActiveStepStatePD::getIndex() const
32 return _Index;
34 uint32 CActiveStepStatePD::getState() const
36 return _State;
38 void CActiveStepStatePD::setState(uint32 __v, bool forceWrite)
40 if ((_State != __v) || forceWrite)
42 PDSLib.set(6, __BaseRow, (RY_PDS::TColumnIndex)(1), __v);
44 _State = __v;
46 CActiveStepPD* CActiveStepStatePD::getStep()
48 return _Step;
50 const CActiveStepPD* CActiveStepStatePD::getStep() const
52 return _Step;
54 void CActiveStepStatePD::clear()
56 _State = 0;
57 PDSLib.set(6, __BaseRow, (RY_PDS::TColumnIndex)(1), 0);
59 CActiveStepStatePD* CActiveStepStatePD::cast(RY_PDS::IPDBaseData* obj)
61 return (obj->getTable() == 6) ? static_cast<CActiveStepStatePD*>(obj) : NULL;
63 const CActiveStepStatePD* CActiveStepStatePD::cast(const RY_PDS::IPDBaseData* obj)
65 return (obj->getTable() == 6) ? static_cast<const CActiveStepStatePD*>(obj) : NULL;
67 void CActiveStepStatePD::apply(CPersistentDataRecord &__pdr)
69 uint16 __Tok_MapKey = __pdr.addString("__Key__");
70 uint16 __Tok_MapVal = __pdr.addString("__Val__");
71 uint16 __Tok_ClassName = __pdr.addString("__Class__");
72 uint16 __TokIndex = __pdr.addString("Index");
73 uint16 __TokState = __pdr.addString("State");
74 _Step = NULL;
75 while (!__pdr.isEndOfStruct())
77 if (false) {}
78 else if (__pdr.peekNextToken() == __TokIndex)
80 __pdr.pop(__TokIndex, _Index);
82 else if (__pdr.peekNextToken() == __TokState)
84 __pdr.pop(__TokState, _State);
86 else
88 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
89 __pdr.skipData();
93 void CActiveStepStatePD::store(CPersistentDataRecord &__pdr) const
95 uint16 __Tok_MapKey = __pdr.addString("__Key__");
96 uint16 __Tok_MapVal = __pdr.addString("__Val__");
97 uint16 __Tok_ClassName = __pdr.addString("__Class__");
98 uint16 __TokIndex = __pdr.addString("Index");
99 uint16 __TokState = __pdr.addString("State");
100 __pdr.push(__TokIndex, _Index);
101 __pdr.push(__TokState, _State);
103 void CActiveStepStatePD::pds__init(const uint32 &Index)
105 _Index = Index;
106 _State = 0;
107 _Step = NULL;
109 void CActiveStepStatePD::pds__destroy()
112 void CActiveStepStatePD::pds__fetch(RY_PDS::CPData &data)
114 data.serial(_Index);
115 data.serial(_State);
116 _Step = NULL;
118 void CActiveStepStatePD::pds__register()
120 __BaseRow = _IndexAllocator.allocate();
121 PDSLib.allocateRow(6, __BaseRow, 0);
122 pds__registerAttributes();
124 void CActiveStepStatePD::pds__registerAttributes()
126 if (RY_PDS::PDVerbose) nldebug("CActiveStepStatePD: registerAttributes %u:%u", 6, __BaseRow);
127 PDSLib.set(6, __BaseRow, (RY_PDS::TColumnIndex)(0), _Index);
129 void CActiveStepStatePD::pds__unregister()
131 pds__unregisterAttributes();
132 PDSLib.deallocateRow(6, __BaseRow);
133 _IndexAllocator.deallocate(__BaseRow);
135 void CActiveStepStatePD::pds__unregisterAttributes()
137 if (RY_PDS::PDVerbose) nldebug("CActiveStepStatePD: unregisterAttributes %u:%u", 6, __BaseRow);
138 pds__setParent(NULL);
140 void CActiveStepStatePD::pds__setParent(CActiveStepPD* __parent)
142 _Step = __parent;
143 PDSLib.setParent(6, getRow(), (RY_PDS::TColumnIndex)(2), (__parent != NULL ? RY_PDS::CObjectIndex(7, __parent->getRow()) : RY_PDS::CObjectIndex::null()));
145 void CActiveStepStatePD::pds__setParentUnnotified(CActiveStepPD* __parent)
147 _Step = __parent;
149 void CActiveStepStatePD::pds__notifyInit()
152 void CActiveStepStatePD::pds__notifyRelease()
154 PDSLib.release(6, __BaseRow);
156 void CActiveStepStatePD::pds_static__init()
158 PDSLib.setIndexAllocator(6, _IndexAllocator);
160 RY_PDS::CIndexAllocator CActiveStepStatePD::_IndexAllocator;
161 // End of static implementation of CActiveStepStatePD
163 /* -----------------------------------------
164 * Static Implementation of CActiveStepPD
165 * ----------------------------------------- */
166 uint32 CActiveStepPD::getIndexInTemplate() const
168 return _IndexInTemplate;
170 CActiveStepStatePD* CActiveStepPD::getStates(const uint32& __k)
172 std::map<uint32, CActiveStepStatePD>::iterator _it = _States.find(__k);
173 return (_it==_States.end() ? NULL : &((*_it).second));
175 const CActiveStepStatePD* CActiveStepPD::getStates(const uint32& __k) const
177 std::map<uint32, CActiveStepStatePD>::const_iterator _it = _States.find(__k);
178 return (_it==_States.end() ? NULL : &((*_it).second));
180 std::map<uint32, CActiveStepStatePD>::iterator CActiveStepPD::getStatesBegin()
182 return _States.begin();
184 std::map<uint32, CActiveStepStatePD>::iterator CActiveStepPD::getStatesEnd()
186 return _States.end();
188 std::map<uint32, CActiveStepStatePD>::const_iterator CActiveStepPD::getStatesBegin() const
190 return _States.begin();
192 std::map<uint32, CActiveStepStatePD>::const_iterator CActiveStepPD::getStatesEnd() const
194 return _States.end();
196 const std::map<uint32, CActiveStepStatePD> & CActiveStepPD::getStates() const
198 return _States;
200 CActiveStepStatePD* CActiveStepPD::addToStates(const uint32 &__k)
202 std::map<uint32, CActiveStepStatePD>::iterator __it = _States.find(__k);
203 if (__it == _States.end())
205 __it = _States.insert(std::map<uint32, CActiveStepStatePD>::value_type(__k, CActiveStepStatePD())).first;
206 CActiveStepStatePD* __o = &((*__it).second);
207 __o->pds__init(__k);
208 __o->pds__register();
209 __o->pds__setParent(this);
211 return &((*__it).second);
213 void CActiveStepPD::deleteFromStates(const uint32 &__k)
215 std::map<uint32, CActiveStepStatePD>::iterator __it = _States.find(__k);
216 if (__it == _States.end()) return;
217 CActiveStepStatePD& __o = (*__it).second;
218 __o.pds__unregister();
219 _States.erase(__it);
221 CMissionPD* CActiveStepPD::getMission()
223 return _Mission;
225 const CMissionPD* CActiveStepPD::getMission() const
227 return _Mission;
229 void CActiveStepPD::clear()
231 for (std::map<uint32, CActiveStepStatePD>::iterator __it=_States.begin(); __it!=_States.end(); )
233 std::map<uint32, CActiveStepStatePD>::iterator __itr=__it++;
234 CActiveStepStatePD* __o = &((*__itr).second);
235 __o->pds__unregister();
236 __o->pds__destroy();
238 _States.clear();
240 CActiveStepPD* CActiveStepPD::cast(RY_PDS::IPDBaseData* obj)
242 return (obj->getTable() == 7) ? static_cast<CActiveStepPD*>(obj) : NULL;
244 const CActiveStepPD* CActiveStepPD::cast(const RY_PDS::IPDBaseData* obj)
246 return (obj->getTable() == 7) ? static_cast<const CActiveStepPD*>(obj) : NULL;
248 void CActiveStepPD::apply(CPersistentDataRecord &__pdr)
250 uint16 __Tok_MapKey = __pdr.addString("__Key__");
251 uint16 __Tok_MapVal = __pdr.addString("__Val__");
252 uint16 __Tok_ClassName = __pdr.addString("__Class__");
253 uint16 __TokIndexInTemplate = __pdr.addString("IndexInTemplate");
254 uint16 __TokStates = __pdr.addString("States");
255 _Mission = NULL;
256 while (!__pdr.isEndOfStruct())
258 if (false) {}
259 else if (__pdr.peekNextToken() == __TokIndexInTemplate)
261 __pdr.pop(__TokIndexInTemplate, _IndexInTemplate);
263 // apply States
264 else if (__pdr.peekNextToken() == __TokStates)
266 __pdr.popStructBegin(__TokStates);
267 while (!__pdr.isEndOfStruct())
269 uint32 key;
270 __pdr.pop(__Tok_MapKey, key);
271 __pdr.popStructBegin(__Tok_MapVal);
272 CActiveStepStatePD& obj = _States[key];
273 obj.apply(__pdr);
274 obj.pds__setParentUnnotified(this);
275 __pdr.popStructEnd(__Tok_MapVal);
277 __pdr.popStructEnd(__TokStates);
279 // end of apply States
280 else
282 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
283 __pdr.skipData();
287 void CActiveStepPD::store(CPersistentDataRecord &__pdr) const
289 uint16 __Tok_MapKey = __pdr.addString("__Key__");
290 uint16 __Tok_MapVal = __pdr.addString("__Val__");
291 uint16 __Tok_ClassName = __pdr.addString("__Class__");
292 uint16 __TokIndexInTemplate = __pdr.addString("IndexInTemplate");
293 uint16 __TokStates = __pdr.addString("States");
294 __pdr.push(__TokIndexInTemplate, _IndexInTemplate);
295 // store States
296 __pdr.pushStructBegin(__TokStates);
297 for (std::map<uint32, CActiveStepStatePD>::const_iterator it=_States.begin(); it!=_States.end(); ++it)
299 uint32 key = (*it).first;
300 __pdr.push(__Tok_MapKey, key);
301 __pdr.pushStructBegin(__Tok_MapVal);
302 (*it).second.store(__pdr);
303 __pdr.pushStructEnd(__Tok_MapVal);
305 __pdr.pushStructEnd(__TokStates);
306 // end of store States
308 void CActiveStepPD::pds__init(const uint32 &IndexInTemplate)
310 _IndexInTemplate = IndexInTemplate;
311 _Mission = NULL;
313 void CActiveStepPD::pds__destroy()
315 for (std::map<uint32, CActiveStepStatePD>::iterator __it=_States.begin(); __it!=_States.end(); )
317 std::map<uint32, CActiveStepStatePD>::iterator __itr=__it++;
318 ((*__itr).second).pds__destroy();
320 _States.clear();
322 void CActiveStepPD::pds__fetch(RY_PDS::CPData &data)
324 data.serial(_IndexInTemplate);
325 RY_PDS::TTableIndex tableIndex;
326 RY_PDS::TRowIndex rowIndex;
329 // read table and row, create an object, affect to the ref, and fetch it
330 data.serial(tableIndex, rowIndex);
331 if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break;
332 uint32 __k;
333 data.serial(__k);
334 _States.insert(std::pair<uint32,CActiveStepStatePD>(__k, CActiveStepStatePD()));
335 CActiveStepStatePD* __o = &(_States[__k]);
336 PDSLib.setRowIndex(rowIndex, __o);
337 __o->pds__fetch(data);
338 __o->pds__setParentUnnotified(this);
340 while (true);
341 _Mission = NULL;
343 void CActiveStepPD::pds__register()
345 __BaseRow = _IndexAllocator.allocate();
346 PDSLib.allocateRow(7, __BaseRow, 0);
347 pds__registerAttributes();
349 void CActiveStepPD::pds__registerAttributes()
351 if (RY_PDS::PDVerbose) nldebug("CActiveStepPD: registerAttributes %u:%u", 7, __BaseRow);
352 PDSLib.set(7, __BaseRow, (RY_PDS::TColumnIndex)(0), _IndexInTemplate);
354 void CActiveStepPD::pds__unregister()
356 pds__unregisterAttributes();
357 PDSLib.deallocateRow(7, __BaseRow);
358 _IndexAllocator.deallocate(__BaseRow);
360 void CActiveStepPD::pds__unregisterAttributes()
362 if (RY_PDS::PDVerbose) nldebug("CActiveStepPD: unregisterAttributes %u:%u", 7, __BaseRow);
363 pds__setParent(NULL);
364 for (std::map<uint32, CActiveStepStatePD>::iterator __it=_States.begin(); __it!=_States.end(); )
366 std::map<uint32, CActiveStepStatePD>::iterator __itr=__it++;
367 CActiveStepStatePD& __o = (*__itr).second;
368 __o.pds__unregister();
371 void CActiveStepPD::pds__setParent(CMissionPD* __parent)
373 _Mission = __parent;
374 PDSLib.setParent(7, getRow(), (RY_PDS::TColumnIndex)(2), (__parent != NULL ? RY_PDS::CObjectIndex(__parent->getTable(), __parent->getRow()) : RY_PDS::CObjectIndex::null()));
376 void CActiveStepPD::pds__setParentUnnotified(CMissionPD* __parent)
378 _Mission = __parent;
380 void CActiveStepPD::pds__notifyInit()
382 for (std::map<uint32, CActiveStepStatePD>::iterator __it=_States.begin(); __it!=_States.end(); )
384 std::map<uint32, CActiveStepStatePD>::iterator __itr=__it++;
385 (*__itr).second.pds__notifyInit();
388 void CActiveStepPD::pds__notifyRelease()
390 PDSLib.release(7, __BaseRow);
391 for (std::map<uint32, CActiveStepStatePD>::iterator __it=_States.begin(); __it!=_States.end(); )
393 std::map<uint32, CActiveStepStatePD>::iterator __itr=__it++;
394 (*__itr).second.pds__notifyRelease();
397 void CActiveStepPD::pds_static__init()
399 PDSLib.setIndexAllocator(7, _IndexAllocator);
401 RY_PDS::CIndexAllocator CActiveStepPD::_IndexAllocator;
402 // End of static implementation of CActiveStepPD
404 /* -----------------------------------------
405 * Static Implementation of CDoneStepPD
406 * ----------------------------------------- */
407 uint32 CDoneStepPD::getIndex() const
409 return _Index;
411 CMissionPD* CDoneStepPD::getMission()
413 return _Mission;
415 const CMissionPD* CDoneStepPD::getMission() const
417 return _Mission;
419 void CDoneStepPD::clear()
422 CDoneStepPD* CDoneStepPD::cast(RY_PDS::IPDBaseData* obj)
424 return (obj->getTable() == 8) ? static_cast<CDoneStepPD*>(obj) : NULL;
426 const CDoneStepPD* CDoneStepPD::cast(const RY_PDS::IPDBaseData* obj)
428 return (obj->getTable() == 8) ? static_cast<const CDoneStepPD*>(obj) : NULL;
430 void CDoneStepPD::apply(CPersistentDataRecord &__pdr)
432 uint16 __Tok_MapKey = __pdr.addString("__Key__");
433 uint16 __Tok_MapVal = __pdr.addString("__Val__");
434 uint16 __Tok_ClassName = __pdr.addString("__Class__");
435 uint16 __TokIndex = __pdr.addString("Index");
436 _Mission = NULL;
437 while (!__pdr.isEndOfStruct())
439 if (false) {}
440 else if (__pdr.peekNextToken() == __TokIndex)
442 __pdr.pop(__TokIndex, _Index);
444 else
446 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
447 __pdr.skipData();
451 void CDoneStepPD::store(CPersistentDataRecord &__pdr) const
453 uint16 __Tok_MapKey = __pdr.addString("__Key__");
454 uint16 __Tok_MapVal = __pdr.addString("__Val__");
455 uint16 __Tok_ClassName = __pdr.addString("__Class__");
456 uint16 __TokIndex = __pdr.addString("Index");
457 __pdr.push(__TokIndex, _Index);
459 void CDoneStepPD::pds__init(const uint32 &Index)
461 _Index = Index;
462 _Mission = NULL;
464 void CDoneStepPD::pds__destroy()
467 void CDoneStepPD::pds__fetch(RY_PDS::CPData &data)
469 data.serial(_Index);
470 _Mission = NULL;
472 void CDoneStepPD::pds__register()
474 __BaseRow = _IndexAllocator.allocate();
475 PDSLib.allocateRow(8, __BaseRow, 0);
476 pds__registerAttributes();
478 void CDoneStepPD::pds__registerAttributes()
480 if (RY_PDS::PDVerbose) nldebug("CDoneStepPD: registerAttributes %u:%u", 8, __BaseRow);
481 PDSLib.set(8, __BaseRow, (RY_PDS::TColumnIndex)(0), _Index);
483 void CDoneStepPD::pds__unregister()
485 pds__unregisterAttributes();
486 PDSLib.deallocateRow(8, __BaseRow);
487 _IndexAllocator.deallocate(__BaseRow);
489 void CDoneStepPD::pds__unregisterAttributes()
491 if (RY_PDS::PDVerbose) nldebug("CDoneStepPD: unregisterAttributes %u:%u", 8, __BaseRow);
492 pds__setParent(NULL);
494 void CDoneStepPD::pds__setParent(CMissionPD* __parent)
496 _Mission = __parent;
497 PDSLib.setParent(8, getRow(), (RY_PDS::TColumnIndex)(1), (__parent != NULL ? RY_PDS::CObjectIndex(__parent->getTable(), __parent->getRow()) : RY_PDS::CObjectIndex::null()));
499 void CDoneStepPD::pds__setParentUnnotified(CMissionPD* __parent)
501 _Mission = __parent;
503 void CDoneStepPD::pds__notifyInit()
506 void CDoneStepPD::pds__notifyRelease()
508 PDSLib.release(8, __BaseRow);
510 void CDoneStepPD::pds_static__init()
512 PDSLib.setIndexAllocator(8, _IndexAllocator);
514 RY_PDS::CIndexAllocator CDoneStepPD::_IndexAllocator;
515 // End of static implementation of CDoneStepPD
517 /* -----------------------------------------
518 * Static Implementation of CMissionCompassPD
519 * ----------------------------------------- */
520 uint32 CMissionCompassPD::getIndex() const
522 return _Index;
524 uint32 CMissionCompassPD::getPlace() const
526 return _Place;
528 void CMissionCompassPD::setPlace(uint32 __v, bool forceWrite)
530 if ((_Place != __v) || forceWrite)
532 PDSLib.set(9, __BaseRow, (RY_PDS::TColumnIndex)(1), __v);
534 _Place = __v;
536 uint32 CMissionCompassPD::getBotId() const
538 return _BotId;
540 void CMissionCompassPD::setBotId(uint32 __v, bool forceWrite)
542 if ((_BotId != __v) || forceWrite)
544 PDSLib.set(9, __BaseRow, (RY_PDS::TColumnIndex)(2), __v);
546 _BotId = __v;
548 CMissionPD* CMissionCompassPD::getMission()
550 return _Mission;
552 const CMissionPD* CMissionCompassPD::getMission() const
554 return _Mission;
556 void CMissionCompassPD::clear()
558 _Place = 0;
559 PDSLib.set(9, __BaseRow, (RY_PDS::TColumnIndex)(1), 0);
560 _BotId = 0;
561 PDSLib.set(9, __BaseRow, (RY_PDS::TColumnIndex)(2), 0);
563 CMissionCompassPD* CMissionCompassPD::cast(RY_PDS::IPDBaseData* obj)
565 return (obj->getTable() == 9) ? static_cast<CMissionCompassPD*>(obj) : NULL;
567 const CMissionCompassPD* CMissionCompassPD::cast(const RY_PDS::IPDBaseData* obj)
569 return (obj->getTable() == 9) ? static_cast<const CMissionCompassPD*>(obj) : NULL;
571 void CMissionCompassPD::apply(CPersistentDataRecord &__pdr)
573 uint16 __Tok_MapKey = __pdr.addString("__Key__");
574 uint16 __Tok_MapVal = __pdr.addString("__Val__");
575 uint16 __Tok_ClassName = __pdr.addString("__Class__");
576 uint16 __TokIndex = __pdr.addString("Index");
577 uint16 __TokPlace = __pdr.addString("Place");
578 uint16 __TokBotId = __pdr.addString("BotId");
579 _Mission = NULL;
580 while (!__pdr.isEndOfStruct())
582 if (false) {}
583 else if (__pdr.peekNextToken() == __TokIndex)
585 __pdr.pop(__TokIndex, _Index);
587 else if (__pdr.peekNextToken() == __TokPlace)
589 __pdr.pop(__TokPlace, _Place);
591 else if (__pdr.peekNextToken() == __TokBotId)
593 __pdr.pop(__TokBotId, _BotId);
595 else
597 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
598 __pdr.skipData();
602 void CMissionCompassPD::store(CPersistentDataRecord &__pdr) const
604 uint16 __Tok_MapKey = __pdr.addString("__Key__");
605 uint16 __Tok_MapVal = __pdr.addString("__Val__");
606 uint16 __Tok_ClassName = __pdr.addString("__Class__");
607 uint16 __TokIndex = __pdr.addString("Index");
608 uint16 __TokPlace = __pdr.addString("Place");
609 uint16 __TokBotId = __pdr.addString("BotId");
610 __pdr.push(__TokIndex, _Index);
611 __pdr.push(__TokPlace, _Place);
612 __pdr.push(__TokBotId, _BotId);
614 void CMissionCompassPD::pds__init(const uint32 &Index)
616 _Index = Index;
617 _Place = 0;
618 _BotId = 0;
619 _Mission = NULL;
621 void CMissionCompassPD::pds__destroy()
624 void CMissionCompassPD::pds__fetch(RY_PDS::CPData &data)
626 data.serial(_Index);
627 data.serial(_Place);
628 data.serial(_BotId);
629 _Mission = NULL;
631 void CMissionCompassPD::pds__register()
633 __BaseRow = _IndexAllocator.allocate();
634 PDSLib.allocateRow(9, __BaseRow, 0);
635 pds__registerAttributes();
637 void CMissionCompassPD::pds__registerAttributes()
639 if (RY_PDS::PDVerbose) nldebug("CMissionCompassPD: registerAttributes %u:%u", 9, __BaseRow);
640 PDSLib.set(9, __BaseRow, (RY_PDS::TColumnIndex)(0), _Index);
642 void CMissionCompassPD::pds__unregister()
644 pds__unregisterAttributes();
645 PDSLib.deallocateRow(9, __BaseRow);
646 _IndexAllocator.deallocate(__BaseRow);
648 void CMissionCompassPD::pds__unregisterAttributes()
650 if (RY_PDS::PDVerbose) nldebug("CMissionCompassPD: unregisterAttributes %u:%u", 9, __BaseRow);
651 pds__setParent(NULL);
653 void CMissionCompassPD::pds__setParent(CMissionPD* __parent)
655 _Mission = __parent;
656 PDSLib.setParent(9, getRow(), (RY_PDS::TColumnIndex)(3), (__parent != NULL ? RY_PDS::CObjectIndex(__parent->getTable(), __parent->getRow()) : RY_PDS::CObjectIndex::null()));
658 void CMissionCompassPD::pds__setParentUnnotified(CMissionPD* __parent)
660 _Mission = __parent;
662 void CMissionCompassPD::pds__notifyInit()
665 // CMissionCompassPD init user code, defined at entities_game_service/pd_scripts/mission.pds:27
666 NameStringId = 0;
667 NameString.clear();
670 void CMissionCompassPD::pds__notifyRelease()
672 PDSLib.release(9, __BaseRow);
674 void CMissionCompassPD::pds_static__init()
676 PDSLib.setIndexAllocator(9, _IndexAllocator);
678 RY_PDS::CIndexAllocator CMissionCompassPD::_IndexAllocator;
679 // End of static implementation of CMissionCompassPD
681 /* -----------------------------------------
682 * Static Implementation of CMissionTeleportPD
683 * ----------------------------------------- */
684 uint32 CMissionTeleportPD::getIndex() const
686 return _Index;
688 CMissionPD* CMissionTeleportPD::getMission()
690 return _Mission;
692 const CMissionPD* CMissionTeleportPD::getMission() const
694 return _Mission;
696 void CMissionTeleportPD::clear()
699 CMissionTeleportPD* CMissionTeleportPD::cast(RY_PDS::IPDBaseData* obj)
701 return (obj->getTable() == 10) ? static_cast<CMissionTeleportPD*>(obj) : NULL;
703 const CMissionTeleportPD* CMissionTeleportPD::cast(const RY_PDS::IPDBaseData* obj)
705 return (obj->getTable() == 10) ? static_cast<const CMissionTeleportPD*>(obj) : NULL;
707 void CMissionTeleportPD::apply(CPersistentDataRecord &__pdr)
709 uint16 __Tok_MapKey = __pdr.addString("__Key__");
710 uint16 __Tok_MapVal = __pdr.addString("__Val__");
711 uint16 __Tok_ClassName = __pdr.addString("__Class__");
712 uint16 __TokIndex = __pdr.addString("Index");
713 _Mission = NULL;
714 while (!__pdr.isEndOfStruct())
716 if (false) {}
717 else if (__pdr.peekNextToken() == __TokIndex)
719 __pdr.pop(__TokIndex, _Index);
721 else
723 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
724 __pdr.skipData();
728 void CMissionTeleportPD::store(CPersistentDataRecord &__pdr) const
730 uint16 __Tok_MapKey = __pdr.addString("__Key__");
731 uint16 __Tok_MapVal = __pdr.addString("__Val__");
732 uint16 __Tok_ClassName = __pdr.addString("__Class__");
733 uint16 __TokIndex = __pdr.addString("Index");
734 __pdr.push(__TokIndex, _Index);
736 void CMissionTeleportPD::pds__init(const uint32 &Index)
738 _Index = Index;
739 _Mission = NULL;
741 void CMissionTeleportPD::pds__destroy()
744 void CMissionTeleportPD::pds__fetch(RY_PDS::CPData &data)
746 data.serial(_Index);
747 _Mission = NULL;
749 void CMissionTeleportPD::pds__register()
751 __BaseRow = _IndexAllocator.allocate();
752 PDSLib.allocateRow(10, __BaseRow, 0);
753 pds__registerAttributes();
755 void CMissionTeleportPD::pds__registerAttributes()
757 if (RY_PDS::PDVerbose) nldebug("CMissionTeleportPD: registerAttributes %u:%u", 10, __BaseRow);
758 PDSLib.set(10, __BaseRow, (RY_PDS::TColumnIndex)(0), _Index);
760 void CMissionTeleportPD::pds__unregister()
762 pds__unregisterAttributes();
763 PDSLib.deallocateRow(10, __BaseRow);
764 _IndexAllocator.deallocate(__BaseRow);
766 void CMissionTeleportPD::pds__unregisterAttributes()
768 if (RY_PDS::PDVerbose) nldebug("CMissionTeleportPD: unregisterAttributes %u:%u", 10, __BaseRow);
769 pds__setParent(NULL);
771 void CMissionTeleportPD::pds__setParent(CMissionPD* __parent)
773 _Mission = __parent;
774 PDSLib.setParent(10, getRow(), (RY_PDS::TColumnIndex)(1), (__parent != NULL ? RY_PDS::CObjectIndex(__parent->getTable(), __parent->getRow()) : RY_PDS::CObjectIndex::null()));
776 void CMissionTeleportPD::pds__setParentUnnotified(CMissionPD* __parent)
778 _Mission = __parent;
780 void CMissionTeleportPD::pds__notifyInit()
783 void CMissionTeleportPD::pds__notifyRelease()
785 PDSLib.release(10, __BaseRow);
787 void CMissionTeleportPD::pds_static__init()
789 PDSLib.setIndexAllocator(10, _IndexAllocator);
791 RY_PDS::CIndexAllocator CMissionTeleportPD::_IndexAllocator;
792 // End of static implementation of CMissionTeleportPD
794 /* -----------------------------------------
795 * Static Implementation of CMissionInsidePlacePD
796 * ----------------------------------------- */
797 uint32 CMissionInsidePlacePD::getAlias() const
799 return _Alias;
801 uint32 CMissionInsidePlacePD::getDelay() const
803 return _Delay;
805 void CMissionInsidePlacePD::setDelay(uint32 __v, bool forceWrite)
807 if ((_Delay != __v) || forceWrite)
809 PDSLib.set(11, __BaseRow, (RY_PDS::TColumnIndex)(1), __v);
811 _Delay = __v;
813 CMissionPD* CMissionInsidePlacePD::getMission()
815 return _Mission;
817 const CMissionPD* CMissionInsidePlacePD::getMission() const
819 return _Mission;
821 void CMissionInsidePlacePD::clear()
823 _Delay = 0;
824 PDSLib.set(11, __BaseRow, (RY_PDS::TColumnIndex)(1), 0);
826 CMissionInsidePlacePD* CMissionInsidePlacePD::cast(RY_PDS::IPDBaseData* obj)
828 return (obj->getTable() == 11) ? static_cast<CMissionInsidePlacePD*>(obj) : NULL;
830 const CMissionInsidePlacePD* CMissionInsidePlacePD::cast(const RY_PDS::IPDBaseData* obj)
832 return (obj->getTable() == 11) ? static_cast<const CMissionInsidePlacePD*>(obj) : NULL;
834 void CMissionInsidePlacePD::apply(CPersistentDataRecord &__pdr)
836 uint16 __Tok_MapKey = __pdr.addString("__Key__");
837 uint16 __Tok_MapVal = __pdr.addString("__Val__");
838 uint16 __Tok_ClassName = __pdr.addString("__Class__");
839 uint16 __TokAlias = __pdr.addString("Alias");
840 uint16 __TokDelay = __pdr.addString("Delay");
841 _Mission = NULL;
842 while (!__pdr.isEndOfStruct())
844 if (false) {}
845 else if (__pdr.peekNextToken() == __TokAlias)
847 __pdr.pop(__TokAlias, _Alias);
849 else if (__pdr.peekNextToken() == __TokDelay)
851 __pdr.pop(__TokDelay, _Delay);
853 else
855 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
856 __pdr.skipData();
860 void CMissionInsidePlacePD::store(CPersistentDataRecord &__pdr) const
862 uint16 __Tok_MapKey = __pdr.addString("__Key__");
863 uint16 __Tok_MapVal = __pdr.addString("__Val__");
864 uint16 __Tok_ClassName = __pdr.addString("__Class__");
865 uint16 __TokAlias = __pdr.addString("Alias");
866 uint16 __TokDelay = __pdr.addString("Delay");
867 __pdr.push(__TokAlias, _Alias);
868 __pdr.push(__TokDelay, _Delay);
870 void CMissionInsidePlacePD::pds__init(const uint32 &Alias)
872 _Alias = Alias;
873 _Delay = 0;
874 _Mission = NULL;
876 void CMissionInsidePlacePD::pds__destroy()
879 void CMissionInsidePlacePD::pds__fetch(RY_PDS::CPData &data)
881 data.serial(_Alias);
882 data.serial(_Delay);
883 _Mission = NULL;
885 void CMissionInsidePlacePD::pds__register()
887 __BaseRow = _IndexAllocator.allocate();
888 PDSLib.allocateRow(11, __BaseRow, 0);
889 pds__registerAttributes();
891 void CMissionInsidePlacePD::pds__registerAttributes()
893 if (RY_PDS::PDVerbose) nldebug("CMissionInsidePlacePD: registerAttributes %u:%u", 11, __BaseRow);
894 PDSLib.set(11, __BaseRow, (RY_PDS::TColumnIndex)(0), _Alias);
896 void CMissionInsidePlacePD::pds__unregister()
898 pds__unregisterAttributes();
899 PDSLib.deallocateRow(11, __BaseRow);
900 _IndexAllocator.deallocate(__BaseRow);
902 void CMissionInsidePlacePD::pds__unregisterAttributes()
904 if (RY_PDS::PDVerbose) nldebug("CMissionInsidePlacePD: unregisterAttributes %u:%u", 11, __BaseRow);
905 pds__setParent(NULL);
907 void CMissionInsidePlacePD::pds__setParent(CMissionPD* __parent)
909 _Mission = __parent;
910 PDSLib.setParent(11, getRow(), (RY_PDS::TColumnIndex)(2), (__parent != NULL ? RY_PDS::CObjectIndex(__parent->getTable(), __parent->getRow()) : RY_PDS::CObjectIndex::null()));
912 void CMissionInsidePlacePD::pds__setParentUnnotified(CMissionPD* __parent)
914 _Mission = __parent;
916 void CMissionInsidePlacePD::pds__notifyInit()
919 void CMissionInsidePlacePD::pds__notifyRelease()
921 PDSLib.release(11, __BaseRow);
923 void CMissionInsidePlacePD::pds_static__init()
925 PDSLib.setIndexAllocator(11, _IndexAllocator);
927 RY_PDS::CIndexAllocator CMissionInsidePlacePD::_IndexAllocator;
928 // End of static implementation of CMissionInsidePlacePD
930 /* -----------------------------------------
931 * Static Implementation of CMissionOutsidePlacePD
932 * ----------------------------------------- */
933 uint32 CMissionOutsidePlacePD::getAlias() const
935 return _Alias;
937 uint32 CMissionOutsidePlacePD::getDelay() const
939 return _Delay;
941 void CMissionOutsidePlacePD::setDelay(uint32 __v, bool forceWrite)
943 if ((_Delay != __v) || forceWrite)
945 PDSLib.set(12, __BaseRow, (RY_PDS::TColumnIndex)(1), __v);
947 _Delay = __v;
949 CMissionPD* CMissionOutsidePlacePD::getMission()
951 return _Mission;
953 const CMissionPD* CMissionOutsidePlacePD::getMission() const
955 return _Mission;
957 void CMissionOutsidePlacePD::clear()
959 _Delay = 0;
960 PDSLib.set(12, __BaseRow, (RY_PDS::TColumnIndex)(1), 0);
962 CMissionOutsidePlacePD* CMissionOutsidePlacePD::cast(RY_PDS::IPDBaseData* obj)
964 return (obj->getTable() == 12) ? static_cast<CMissionOutsidePlacePD*>(obj) : NULL;
966 const CMissionOutsidePlacePD* CMissionOutsidePlacePD::cast(const RY_PDS::IPDBaseData* obj)
968 return (obj->getTable() == 12) ? static_cast<const CMissionOutsidePlacePD*>(obj) : NULL;
970 void CMissionOutsidePlacePD::apply(CPersistentDataRecord &__pdr)
972 uint16 __Tok_MapKey = __pdr.addString("__Key__");
973 uint16 __Tok_MapVal = __pdr.addString("__Val__");
974 uint16 __Tok_ClassName = __pdr.addString("__Class__");
975 uint16 __TokAlias = __pdr.addString("Alias");
976 uint16 __TokDelay = __pdr.addString("Delay");
977 _Mission = NULL;
978 while (!__pdr.isEndOfStruct())
980 if (false) {}
981 else if (__pdr.peekNextToken() == __TokAlias)
983 __pdr.pop(__TokAlias, _Alias);
985 else if (__pdr.peekNextToken() == __TokDelay)
987 __pdr.pop(__TokDelay, _Delay);
989 else
991 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
992 __pdr.skipData();
996 void CMissionOutsidePlacePD::store(CPersistentDataRecord &__pdr) const
998 uint16 __Tok_MapKey = __pdr.addString("__Key__");
999 uint16 __Tok_MapVal = __pdr.addString("__Val__");
1000 uint16 __Tok_ClassName = __pdr.addString("__Class__");
1001 uint16 __TokAlias = __pdr.addString("Alias");
1002 uint16 __TokDelay = __pdr.addString("Delay");
1003 __pdr.push(__TokAlias, _Alias);
1004 __pdr.push(__TokDelay, _Delay);
1006 void CMissionOutsidePlacePD::pds__init(const uint32 &Alias)
1008 _Alias = Alias;
1009 _Delay = 0;
1010 _Mission = NULL;
1012 void CMissionOutsidePlacePD::pds__destroy()
1015 void CMissionOutsidePlacePD::pds__fetch(RY_PDS::CPData &data)
1017 data.serial(_Alias);
1018 data.serial(_Delay);
1019 _Mission = NULL;
1021 void CMissionOutsidePlacePD::pds__register()
1023 __BaseRow = _IndexAllocator.allocate();
1024 PDSLib.allocateRow(12, __BaseRow, 0);
1025 pds__registerAttributes();
1027 void CMissionOutsidePlacePD::pds__registerAttributes()
1029 if (RY_PDS::PDVerbose) nldebug("CMissionOutsidePlacePD: registerAttributes %u:%u", 12, __BaseRow);
1030 PDSLib.set(12, __BaseRow, (RY_PDS::TColumnIndex)(0), _Alias);
1032 void CMissionOutsidePlacePD::pds__unregister()
1034 pds__unregisterAttributes();
1035 PDSLib.deallocateRow(12, __BaseRow);
1036 _IndexAllocator.deallocate(__BaseRow);
1038 void CMissionOutsidePlacePD::pds__unregisterAttributes()
1040 if (RY_PDS::PDVerbose) nldebug("CMissionOutsidePlacePD: unregisterAttributes %u:%u", 12, __BaseRow);
1041 pds__setParent(NULL);
1043 void CMissionOutsidePlacePD::pds__setParent(CMissionPD* __parent)
1045 _Mission = __parent;
1046 PDSLib.setParent(12, getRow(), (RY_PDS::TColumnIndex)(2), (__parent != NULL ? RY_PDS::CObjectIndex(__parent->getTable(), __parent->getRow()) : RY_PDS::CObjectIndex::null()));
1048 void CMissionOutsidePlacePD::pds__setParentUnnotified(CMissionPD* __parent)
1050 _Mission = __parent;
1052 void CMissionOutsidePlacePD::pds__notifyInit()
1055 void CMissionOutsidePlacePD::pds__notifyRelease()
1057 PDSLib.release(12, __BaseRow);
1059 void CMissionOutsidePlacePD::pds_static__init()
1061 PDSLib.setIndexAllocator(12, _IndexAllocator);
1063 RY_PDS::CIndexAllocator CMissionOutsidePlacePD::_IndexAllocator;
1064 // End of static implementation of CMissionOutsidePlacePD
1066 /* -----------------------------------------
1067 * Static Implementation of CHandledAIGroupPD
1068 * ----------------------------------------- */
1069 uint32 CHandledAIGroupPD::getGroupAlias() const
1071 return _GroupAlias;
1073 uint32 CHandledAIGroupPD::getDespawnTime() const
1075 return _DespawnTime;
1077 void CHandledAIGroupPD::setDespawnTime(uint32 __v, bool forceWrite)
1079 if ((_DespawnTime != __v) || forceWrite)
1081 PDSLib.set(13, __BaseRow, (RY_PDS::TColumnIndex)(1), __v);
1083 _DespawnTime = __v;
1085 CMissionPD* CHandledAIGroupPD::getMission()
1087 return _Mission;
1089 const CMissionPD* CHandledAIGroupPD::getMission() const
1091 return _Mission;
1093 void CHandledAIGroupPD::clear()
1095 _DespawnTime = 0;
1096 PDSLib.set(13, __BaseRow, (RY_PDS::TColumnIndex)(1), 0);
1098 CHandledAIGroupPD* CHandledAIGroupPD::cast(RY_PDS::IPDBaseData* obj)
1100 return (obj->getTable() == 13) ? static_cast<CHandledAIGroupPD*>(obj) : NULL;
1102 const CHandledAIGroupPD* CHandledAIGroupPD::cast(const RY_PDS::IPDBaseData* obj)
1104 return (obj->getTable() == 13) ? static_cast<const CHandledAIGroupPD*>(obj) : NULL;
1106 void CHandledAIGroupPD::apply(CPersistentDataRecord &__pdr)
1108 uint16 __Tok_MapKey = __pdr.addString("__Key__");
1109 uint16 __Tok_MapVal = __pdr.addString("__Val__");
1110 uint16 __Tok_ClassName = __pdr.addString("__Class__");
1111 uint16 __TokGroupAlias = __pdr.addString("GroupAlias");
1112 uint16 __TokDespawnTime = __pdr.addString("DespawnTime");
1113 _Mission = NULL;
1114 while (!__pdr.isEndOfStruct())
1116 if (false) {}
1117 else if (__pdr.peekNextToken() == __TokGroupAlias)
1119 __pdr.pop(__TokGroupAlias, _GroupAlias);
1121 else if (__pdr.peekNextToken() == __TokDespawnTime)
1123 __pdr.pop(__TokDespawnTime, _DespawnTime);
1125 else
1127 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
1128 __pdr.skipData();
1132 void CHandledAIGroupPD::store(CPersistentDataRecord &__pdr) const
1134 uint16 __Tok_MapKey = __pdr.addString("__Key__");
1135 uint16 __Tok_MapVal = __pdr.addString("__Val__");
1136 uint16 __Tok_ClassName = __pdr.addString("__Class__");
1137 uint16 __TokGroupAlias = __pdr.addString("GroupAlias");
1138 uint16 __TokDespawnTime = __pdr.addString("DespawnTime");
1139 __pdr.push(__TokGroupAlias, _GroupAlias);
1140 __pdr.push(__TokDespawnTime, _DespawnTime);
1142 void CHandledAIGroupPD::pds__init(const uint32 &GroupAlias)
1144 _GroupAlias = GroupAlias;
1145 _DespawnTime = 0;
1146 _Mission = NULL;
1148 void CHandledAIGroupPD::pds__destroy()
1151 void CHandledAIGroupPD::pds__fetch(RY_PDS::CPData &data)
1153 data.serial(_GroupAlias);
1154 data.serial(_DespawnTime);
1155 _Mission = NULL;
1157 void CHandledAIGroupPD::pds__register()
1159 __BaseRow = _IndexAllocator.allocate();
1160 PDSLib.allocateRow(13, __BaseRow, 0);
1161 pds__registerAttributes();
1163 void CHandledAIGroupPD::pds__registerAttributes()
1165 if (RY_PDS::PDVerbose) nldebug("CHandledAIGroupPD: registerAttributes %u:%u", 13, __BaseRow);
1166 PDSLib.set(13, __BaseRow, (RY_PDS::TColumnIndex)(0), _GroupAlias);
1168 void CHandledAIGroupPD::pds__unregister()
1170 pds__unregisterAttributes();
1171 PDSLib.deallocateRow(13, __BaseRow);
1172 _IndexAllocator.deallocate(__BaseRow);
1174 void CHandledAIGroupPD::pds__unregisterAttributes()
1176 if (RY_PDS::PDVerbose) nldebug("CHandledAIGroupPD: unregisterAttributes %u:%u", 13, __BaseRow);
1177 pds__setParent(NULL);
1179 void CHandledAIGroupPD::pds__setParent(CMissionPD* __parent)
1181 _Mission = __parent;
1182 PDSLib.setParent(13, getRow(), (RY_PDS::TColumnIndex)(2), (__parent != NULL ? RY_PDS::CObjectIndex(__parent->getTable(), __parent->getRow()) : RY_PDS::CObjectIndex::null()));
1184 void CHandledAIGroupPD::pds__setParentUnnotified(CMissionPD* __parent)
1186 _Mission = __parent;
1188 void CHandledAIGroupPD::pds__notifyInit()
1191 void CHandledAIGroupPD::pds__notifyRelease()
1193 PDSLib.release(13, __BaseRow);
1195 void CHandledAIGroupPD::pds_static__init()
1197 PDSLib.setIndexAllocator(13, _IndexAllocator);
1199 RY_PDS::CIndexAllocator CHandledAIGroupPD::_IndexAllocator;
1200 // End of static implementation of CHandledAIGroupPD
1202 /* -----------------------------------------
1203 * Static Implementation of CMissionPD
1204 * ----------------------------------------- */
1205 uint32 CMissionPD::getTemplateId() const
1207 return _TemplateId;
1209 uint32 CMissionPD::getMainMissionTemplateId() const
1211 return _MainMissionTemplateId;
1213 void CMissionPD::setMainMissionTemplateId(uint32 __v, bool forceWrite)
1215 if ((_MainMissionTemplateId != __v) || forceWrite)
1217 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(1), __v);
1219 _MainMissionTemplateId = __v;
1221 uint32 CMissionPD::getGiver() const
1223 return _Giver;
1225 void CMissionPD::setGiver(uint32 __v, bool forceWrite)
1227 if ((_Giver != __v) || forceWrite)
1229 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(2), __v);
1231 _Giver = __v;
1233 float CMissionPD::getHourLowerBound() const
1235 return _HourLowerBound;
1237 void CMissionPD::setHourLowerBound(float __v, bool forceWrite)
1239 if ((_HourLowerBound != __v) || forceWrite)
1241 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(3), __v);
1243 _HourLowerBound = __v;
1245 float CMissionPD::getHourUpperBound() const
1247 return _HourUpperBound;
1249 void CMissionPD::setHourUpperBound(float __v, bool forceWrite)
1251 if ((_HourUpperBound != __v) || forceWrite)
1253 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(4), __v);
1255 _HourUpperBound = __v;
1257 CSeason::TSeason CMissionPD::getSeason() const
1259 return _Season;
1261 void CMissionPD::setSeason(CSeason::TSeason __v, bool forceWrite)
1263 nlassert(__v<CSeason::___TSeason_useSize);
1264 if ((_Season != __v) || forceWrite)
1266 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(5), (uint32)__v);
1268 _Season = __v;
1270 uint32 CMissionPD::getMonoEndDate() const
1272 return _MonoEndDate;
1274 void CMissionPD::setMonoEndDate(uint32 __v, bool forceWrite)
1276 if ((_MonoEndDate != __v) || forceWrite)
1278 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(6), __v);
1280 _MonoEndDate = __v;
1282 uint32 CMissionPD::getEndDate() const
1284 return _EndDate;
1286 void CMissionPD::setEndDate(uint32 __v, bool forceWrite)
1288 if ((_EndDate != __v) || forceWrite)
1290 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(7), __v);
1292 _EndDate = __v;
1294 uint32 CMissionPD::getCriticalPartEndDate() const
1296 return _CriticalPartEndDate;
1298 void CMissionPD::setCriticalPartEndDate(uint32 __v, bool forceWrite)
1300 if ((_CriticalPartEndDate != __v) || forceWrite)
1302 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(8), __v);
1304 _CriticalPartEndDate = __v;
1306 uint32 CMissionPD::getBeginDate() const
1308 return _BeginDate;
1310 void CMissionPD::setBeginDate(uint32 __v, bool forceWrite)
1312 if ((_BeginDate != __v) || forceWrite)
1314 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(9), __v);
1316 _BeginDate = __v;
1318 uint32 CMissionPD::getFailureIndex() const
1320 return _FailureIndex;
1322 void CMissionPD::setFailureIndex(uint32 __v, bool forceWrite)
1324 if ((_FailureIndex != __v) || forceWrite)
1326 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(10), __v);
1328 _FailureIndex = __v;
1330 uint32 CMissionPD::getCrashHandlerIndex() const
1332 return _CrashHandlerIndex;
1334 void CMissionPD::setCrashHandlerIndex(uint32 __v, bool forceWrite)
1336 if ((_CrashHandlerIndex != __v) || forceWrite)
1338 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(11), __v);
1340 _CrashHandlerIndex = __v;
1342 uint32 CMissionPD::getPlayerReconnectHandlerIndex() const
1344 return _PlayerReconnectHandlerIndex;
1346 void CMissionPD::setPlayerReconnectHandlerIndex(uint32 __v, bool forceWrite)
1348 if ((_PlayerReconnectHandlerIndex != __v) || forceWrite)
1350 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(12), __v);
1352 _PlayerReconnectHandlerIndex = __v;
1354 bool CMissionPD::getFinished() const
1356 return _Finished;
1358 void CMissionPD::setFinished(bool __v, bool forceWrite)
1360 if ((_Finished != __v) || forceWrite)
1362 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(13), __v);
1364 _Finished = __v;
1366 bool CMissionPD::getMissionSuccess() const
1368 return _MissionSuccess;
1370 void CMissionPD::setMissionSuccess(bool __v, bool forceWrite)
1372 if ((_MissionSuccess != __v) || forceWrite)
1374 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(14), __v);
1376 _MissionSuccess = __v;
1378 uint32 CMissionPD::getDescIndex() const
1380 return _DescIndex;
1382 void CMissionPD::setDescIndex(uint32 __v, bool forceWrite)
1384 if ((_DescIndex != __v) || forceWrite)
1386 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(15), __v);
1388 _DescIndex = __v;
1390 uint32 CMissionPD::getWaitingQueueId() const
1392 return _WaitingQueueId;
1394 void CMissionPD::setWaitingQueueId(uint32 __v, bool forceWrite)
1396 if ((_WaitingQueueId != __v) || forceWrite)
1398 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(16), __v);
1400 _WaitingQueueId = __v;
1402 CActiveStepPD* CMissionPD::getSteps(const uint32& __k)
1404 std::map<uint32, CActiveStepPD>::iterator _it = _Steps.find(__k);
1405 return (_it==_Steps.end() ? NULL : &((*_it).second));
1407 const CActiveStepPD* CMissionPD::getSteps(const uint32& __k) const
1409 std::map<uint32, CActiveStepPD>::const_iterator _it = _Steps.find(__k);
1410 return (_it==_Steps.end() ? NULL : &((*_it).second));
1412 std::map<uint32, CActiveStepPD>::iterator CMissionPD::getStepsBegin()
1414 return _Steps.begin();
1416 std::map<uint32, CActiveStepPD>::iterator CMissionPD::getStepsEnd()
1418 return _Steps.end();
1420 std::map<uint32, CActiveStepPD>::const_iterator CMissionPD::getStepsBegin() const
1422 return _Steps.begin();
1424 std::map<uint32, CActiveStepPD>::const_iterator CMissionPD::getStepsEnd() const
1426 return _Steps.end();
1428 const std::map<uint32, CActiveStepPD> & CMissionPD::getSteps() const
1430 return _Steps;
1432 CActiveStepPD* CMissionPD::addToSteps(const uint32 &__k)
1434 std::map<uint32, CActiveStepPD>::iterator __it = _Steps.find(__k);
1435 if (__it == _Steps.end())
1437 __it = _Steps.insert(std::map<uint32, CActiveStepPD>::value_type(__k, CActiveStepPD())).first;
1438 CActiveStepPD* __o = &((*__it).second);
1439 __o->pds__init(__k);
1440 __o->pds__register();
1441 __o->pds__setParent(this);
1443 return &((*__it).second);
1445 void CMissionPD::deleteFromSteps(const uint32 &__k)
1447 std::map<uint32, CActiveStepPD>::iterator __it = _Steps.find(__k);
1448 if (__it == _Steps.end()) return;
1449 CActiveStepPD& __o = (*__it).second;
1450 __o.pds__unregister();
1451 _Steps.erase(__it);
1453 CMissionCompassPD* CMissionPD::getCompass(const uint32& __k)
1455 std::map<uint32, CMissionCompassPD>::iterator _it = _Compass.find(__k);
1456 return (_it==_Compass.end() ? NULL : &((*_it).second));
1458 const CMissionCompassPD* CMissionPD::getCompass(const uint32& __k) const
1460 std::map<uint32, CMissionCompassPD>::const_iterator _it = _Compass.find(__k);
1461 return (_it==_Compass.end() ? NULL : &((*_it).second));
1463 std::map<uint32, CMissionCompassPD>::iterator CMissionPD::getCompassBegin()
1465 return _Compass.begin();
1467 std::map<uint32, CMissionCompassPD>::iterator CMissionPD::getCompassEnd()
1469 return _Compass.end();
1471 std::map<uint32, CMissionCompassPD>::const_iterator CMissionPD::getCompassBegin() const
1473 return _Compass.begin();
1475 std::map<uint32, CMissionCompassPD>::const_iterator CMissionPD::getCompassEnd() const
1477 return _Compass.end();
1479 const std::map<uint32, CMissionCompassPD> & CMissionPD::getCompass() const
1481 return _Compass;
1483 CMissionCompassPD* CMissionPD::addToCompass(const uint32 &__k)
1485 std::map<uint32, CMissionCompassPD>::iterator __it = _Compass.find(__k);
1486 if (__it == _Compass.end())
1488 __it = _Compass.insert(std::map<uint32, CMissionCompassPD>::value_type(__k, CMissionCompassPD())).first;
1489 CMissionCompassPD* __o = &((*__it).second);
1490 __o->pds__init(__k);
1491 __o->pds__register();
1492 __o->pds__setParent(this);
1494 return &((*__it).second);
1496 void CMissionPD::deleteFromCompass(const uint32 &__k)
1498 std::map<uint32, CMissionCompassPD>::iterator __it = _Compass.find(__k);
1499 if (__it == _Compass.end()) return;
1500 CMissionCompassPD& __o = (*__it).second;
1501 __o.pds__unregister();
1502 _Compass.erase(__it);
1504 CDoneStepPD* CMissionPD::getStepsDone(const uint32& __k)
1506 std::map<uint32, CDoneStepPD>::iterator _it = _StepsDone.find(__k);
1507 return (_it==_StepsDone.end() ? NULL : &((*_it).second));
1509 const CDoneStepPD* CMissionPD::getStepsDone(const uint32& __k) const
1511 std::map<uint32, CDoneStepPD>::const_iterator _it = _StepsDone.find(__k);
1512 return (_it==_StepsDone.end() ? NULL : &((*_it).second));
1514 std::map<uint32, CDoneStepPD>::iterator CMissionPD::getStepsDoneBegin()
1516 return _StepsDone.begin();
1518 std::map<uint32, CDoneStepPD>::iterator CMissionPD::getStepsDoneEnd()
1520 return _StepsDone.end();
1522 std::map<uint32, CDoneStepPD>::const_iterator CMissionPD::getStepsDoneBegin() const
1524 return _StepsDone.begin();
1526 std::map<uint32, CDoneStepPD>::const_iterator CMissionPD::getStepsDoneEnd() const
1528 return _StepsDone.end();
1530 const std::map<uint32, CDoneStepPD> & CMissionPD::getStepsDone() const
1532 return _StepsDone;
1534 CDoneStepPD* CMissionPD::addToStepsDone(const uint32 &__k)
1536 std::map<uint32, CDoneStepPD>::iterator __it = _StepsDone.find(__k);
1537 if (__it == _StepsDone.end())
1539 __it = _StepsDone.insert(std::map<uint32, CDoneStepPD>::value_type(__k, CDoneStepPD())).first;
1540 CDoneStepPD* __o = &((*__it).second);
1541 __o->pds__init(__k);
1542 __o->pds__register();
1543 __o->pds__setParent(this);
1545 return &((*__it).second);
1547 void CMissionPD::deleteFromStepsDone(const uint32 &__k)
1549 std::map<uint32, CDoneStepPD>::iterator __it = _StepsDone.find(__k);
1550 if (__it == _StepsDone.end()) return;
1551 CDoneStepPD& __o = (*__it).second;
1552 __o.pds__unregister();
1553 _StepsDone.erase(__it);
1555 CMissionTeleportPD* CMissionPD::getTeleports(const uint32& __k)
1557 std::map<uint32, CMissionTeleportPD>::iterator _it = _Teleports.find(__k);
1558 return (_it==_Teleports.end() ? NULL : &((*_it).second));
1560 const CMissionTeleportPD* CMissionPD::getTeleports(const uint32& __k) const
1562 std::map<uint32, CMissionTeleportPD>::const_iterator _it = _Teleports.find(__k);
1563 return (_it==_Teleports.end() ? NULL : &((*_it).second));
1565 std::map<uint32, CMissionTeleportPD>::iterator CMissionPD::getTeleportsBegin()
1567 return _Teleports.begin();
1569 std::map<uint32, CMissionTeleportPD>::iterator CMissionPD::getTeleportsEnd()
1571 return _Teleports.end();
1573 std::map<uint32, CMissionTeleportPD>::const_iterator CMissionPD::getTeleportsBegin() const
1575 return _Teleports.begin();
1577 std::map<uint32, CMissionTeleportPD>::const_iterator CMissionPD::getTeleportsEnd() const
1579 return _Teleports.end();
1581 const std::map<uint32, CMissionTeleportPD> & CMissionPD::getTeleports() const
1583 return _Teleports;
1585 CMissionTeleportPD* CMissionPD::addToTeleports(const uint32 &__k)
1587 std::map<uint32, CMissionTeleportPD>::iterator __it = _Teleports.find(__k);
1588 if (__it == _Teleports.end())
1590 __it = _Teleports.insert(std::map<uint32, CMissionTeleportPD>::value_type(__k, CMissionTeleportPD())).first;
1591 CMissionTeleportPD* __o = &((*__it).second);
1592 __o->pds__init(__k);
1593 __o->pds__register();
1594 __o->pds__setParent(this);
1596 return &((*__it).second);
1598 void CMissionPD::deleteFromTeleports(const uint32 &__k)
1600 std::map<uint32, CMissionTeleportPD>::iterator __it = _Teleports.find(__k);
1601 if (__it == _Teleports.end()) return;
1602 CMissionTeleportPD& __o = (*__it).second;
1603 __o.pds__unregister();
1604 _Teleports.erase(__it);
1606 CMissionInsidePlacePD* CMissionPD::getInsidePlaces(const uint32& __k)
1608 std::map<uint32, CMissionInsidePlacePD>::iterator _it = _InsidePlaces.find(__k);
1609 return (_it==_InsidePlaces.end() ? NULL : &((*_it).second));
1611 const CMissionInsidePlacePD* CMissionPD::getInsidePlaces(const uint32& __k) const
1613 std::map<uint32, CMissionInsidePlacePD>::const_iterator _it = _InsidePlaces.find(__k);
1614 return (_it==_InsidePlaces.end() ? NULL : &((*_it).second));
1616 std::map<uint32, CMissionInsidePlacePD>::iterator CMissionPD::getInsidePlacesBegin()
1618 return _InsidePlaces.begin();
1620 std::map<uint32, CMissionInsidePlacePD>::iterator CMissionPD::getInsidePlacesEnd()
1622 return _InsidePlaces.end();
1624 std::map<uint32, CMissionInsidePlacePD>::const_iterator CMissionPD::getInsidePlacesBegin() const
1626 return _InsidePlaces.begin();
1628 std::map<uint32, CMissionInsidePlacePD>::const_iterator CMissionPD::getInsidePlacesEnd() const
1630 return _InsidePlaces.end();
1632 const std::map<uint32, CMissionInsidePlacePD> & CMissionPD::getInsidePlaces() const
1634 return _InsidePlaces;
1636 CMissionInsidePlacePD* CMissionPD::addToInsidePlaces(const uint32 &__k)
1638 std::map<uint32, CMissionInsidePlacePD>::iterator __it = _InsidePlaces.find(__k);
1639 if (__it == _InsidePlaces.end())
1641 __it = _InsidePlaces.insert(std::map<uint32, CMissionInsidePlacePD>::value_type(__k, CMissionInsidePlacePD())).first;
1642 CMissionInsidePlacePD* __o = &((*__it).second);
1643 __o->pds__init(__k);
1644 __o->pds__register();
1645 __o->pds__setParent(this);
1647 return &((*__it).second);
1649 void CMissionPD::deleteFromInsidePlaces(const uint32 &__k)
1651 std::map<uint32, CMissionInsidePlacePD>::iterator __it = _InsidePlaces.find(__k);
1652 if (__it == _InsidePlaces.end()) return;
1653 CMissionInsidePlacePD& __o = (*__it).second;
1654 __o.pds__unregister();
1655 _InsidePlaces.erase(__it);
1657 CMissionOutsidePlacePD* CMissionPD::getOutsidePlaces(const uint32& __k)
1659 std::map<uint32, CMissionOutsidePlacePD>::iterator _it = _OutsidePlaces.find(__k);
1660 return (_it==_OutsidePlaces.end() ? NULL : &((*_it).second));
1662 const CMissionOutsidePlacePD* CMissionPD::getOutsidePlaces(const uint32& __k) const
1664 std::map<uint32, CMissionOutsidePlacePD>::const_iterator _it = _OutsidePlaces.find(__k);
1665 return (_it==_OutsidePlaces.end() ? NULL : &((*_it).second));
1667 std::map<uint32, CMissionOutsidePlacePD>::iterator CMissionPD::getOutsidePlacesBegin()
1669 return _OutsidePlaces.begin();
1671 std::map<uint32, CMissionOutsidePlacePD>::iterator CMissionPD::getOutsidePlacesEnd()
1673 return _OutsidePlaces.end();
1675 std::map<uint32, CMissionOutsidePlacePD>::const_iterator CMissionPD::getOutsidePlacesBegin() const
1677 return _OutsidePlaces.begin();
1679 std::map<uint32, CMissionOutsidePlacePD>::const_iterator CMissionPD::getOutsidePlacesEnd() const
1681 return _OutsidePlaces.end();
1683 const std::map<uint32, CMissionOutsidePlacePD> & CMissionPD::getOutsidePlaces() const
1685 return _OutsidePlaces;
1687 CMissionOutsidePlacePD* CMissionPD::addToOutsidePlaces(const uint32 &__k)
1689 std::map<uint32, CMissionOutsidePlacePD>::iterator __it = _OutsidePlaces.find(__k);
1690 if (__it == _OutsidePlaces.end())
1692 __it = _OutsidePlaces.insert(std::map<uint32, CMissionOutsidePlacePD>::value_type(__k, CMissionOutsidePlacePD())).first;
1693 CMissionOutsidePlacePD* __o = &((*__it).second);
1694 __o->pds__init(__k);
1695 __o->pds__register();
1696 __o->pds__setParent(this);
1698 return &((*__it).second);
1700 void CMissionPD::deleteFromOutsidePlaces(const uint32 &__k)
1702 std::map<uint32, CMissionOutsidePlacePD>::iterator __it = _OutsidePlaces.find(__k);
1703 if (__it == _OutsidePlaces.end()) return;
1704 CMissionOutsidePlacePD& __o = (*__it).second;
1705 __o.pds__unregister();
1706 _OutsidePlaces.erase(__it);
1708 CHandledAIGroupPD* CMissionPD::getHandledAIGroups(const uint32& __k)
1710 std::map<uint32, CHandledAIGroupPD>::iterator _it = _HandledAIGroups.find(__k);
1711 return (_it==_HandledAIGroups.end() ? NULL : &((*_it).second));
1713 const CHandledAIGroupPD* CMissionPD::getHandledAIGroups(const uint32& __k) const
1715 std::map<uint32, CHandledAIGroupPD>::const_iterator _it = _HandledAIGroups.find(__k);
1716 return (_it==_HandledAIGroups.end() ? NULL : &((*_it).second));
1718 std::map<uint32, CHandledAIGroupPD>::iterator CMissionPD::getHandledAIGroupsBegin()
1720 return _HandledAIGroups.begin();
1722 std::map<uint32, CHandledAIGroupPD>::iterator CMissionPD::getHandledAIGroupsEnd()
1724 return _HandledAIGroups.end();
1726 std::map<uint32, CHandledAIGroupPD>::const_iterator CMissionPD::getHandledAIGroupsBegin() const
1728 return _HandledAIGroups.begin();
1730 std::map<uint32, CHandledAIGroupPD>::const_iterator CMissionPD::getHandledAIGroupsEnd() const
1732 return _HandledAIGroups.end();
1734 const std::map<uint32, CHandledAIGroupPD> & CMissionPD::getHandledAIGroups() const
1736 return _HandledAIGroups;
1738 CHandledAIGroupPD* CMissionPD::addToHandledAIGroups(const uint32 &__k)
1740 std::map<uint32, CHandledAIGroupPD>::iterator __it = _HandledAIGroups.find(__k);
1741 if (__it == _HandledAIGroups.end())
1743 __it = _HandledAIGroups.insert(std::map<uint32, CHandledAIGroupPD>::value_type(__k, CHandledAIGroupPD())).first;
1744 CHandledAIGroupPD* __o = &((*__it).second);
1745 __o->pds__init(__k);
1746 __o->pds__register();
1747 __o->pds__setParent(this);
1749 return &((*__it).second);
1751 void CMissionPD::deleteFromHandledAIGroups(const uint32 &__k)
1753 std::map<uint32, CHandledAIGroupPD>::iterator __it = _HandledAIGroups.find(__k);
1754 if (__it == _HandledAIGroups.end()) return;
1755 CHandledAIGroupPD& __o = (*__it).second;
1756 __o.pds__unregister();
1757 _HandledAIGroups.erase(__it);
1759 CMissionContainerPD* CMissionPD::getContainer()
1761 return _Container;
1763 const CMissionContainerPD* CMissionPD::getContainer() const
1765 return _Container;
1767 void CMissionPD::clear()
1769 _MainMissionTemplateId = 0;
1770 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(1), 0);
1771 _Giver = 0;
1772 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(2), 0);
1773 _HourLowerBound = 0.0f;
1774 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(3), 0.0f);
1775 _HourUpperBound = 0.0f;
1776 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(4), 0.0f);
1777 _Season = (CSeason::TSeason)0;
1778 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(5), (uint32)(CSeason::TSeason)0);
1779 _MonoEndDate = 0;
1780 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(6), 0);
1781 _EndDate = 0;
1782 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(7), 0);
1783 _CriticalPartEndDate = 0;
1784 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(8), 0);
1785 _BeginDate = 0;
1786 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(9), 0);
1787 _FailureIndex = 0;
1788 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(10), 0);
1789 _CrashHandlerIndex = 0xFFFFFFFF;
1790 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(11), 0xFFFFFFFF);
1791 _PlayerReconnectHandlerIndex = 0xFFFFFFFF;
1792 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(12), 0xFFFFFFFF);
1793 _Finished = false;
1794 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(13), false);
1795 _MissionSuccess = true;
1796 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(14), true);
1797 _DescIndex = 0;
1798 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(15), 0);
1799 _WaitingQueueId = 0;
1800 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(16), 0);
1801 for (std::map<uint32, CActiveStepPD>::iterator __it=_Steps.begin(); __it!=_Steps.end(); )
1803 std::map<uint32, CActiveStepPD>::iterator __itr=__it++;
1804 CActiveStepPD* __o = &((*__itr).second);
1805 __o->pds__unregister();
1806 __o->pds__destroy();
1808 _Steps.clear();
1809 for (std::map<uint32, CMissionCompassPD>::iterator __it=_Compass.begin(); __it!=_Compass.end(); )
1811 std::map<uint32, CMissionCompassPD>::iterator __itr=__it++;
1812 CMissionCompassPD* __o = &((*__itr).second);
1813 __o->pds__unregister();
1814 __o->pds__destroy();
1816 _Compass.clear();
1817 for (std::map<uint32, CDoneStepPD>::iterator __it=_StepsDone.begin(); __it!=_StepsDone.end(); )
1819 std::map<uint32, CDoneStepPD>::iterator __itr=__it++;
1820 CDoneStepPD* __o = &((*__itr).second);
1821 __o->pds__unregister();
1822 __o->pds__destroy();
1824 _StepsDone.clear();
1825 for (std::map<uint32, CMissionTeleportPD>::iterator __it=_Teleports.begin(); __it!=_Teleports.end(); )
1827 std::map<uint32, CMissionTeleportPD>::iterator __itr=__it++;
1828 CMissionTeleportPD* __o = &((*__itr).second);
1829 __o->pds__unregister();
1830 __o->pds__destroy();
1832 _Teleports.clear();
1833 for (std::map<uint32, CMissionInsidePlacePD>::iterator __it=_InsidePlaces.begin(); __it!=_InsidePlaces.end(); )
1835 std::map<uint32, CMissionInsidePlacePD>::iterator __itr=__it++;
1836 CMissionInsidePlacePD* __o = &((*__itr).second);
1837 __o->pds__unregister();
1838 __o->pds__destroy();
1840 _InsidePlaces.clear();
1841 for (std::map<uint32, CMissionOutsidePlacePD>::iterator __it=_OutsidePlaces.begin(); __it!=_OutsidePlaces.end(); )
1843 std::map<uint32, CMissionOutsidePlacePD>::iterator __itr=__it++;
1844 CMissionOutsidePlacePD* __o = &((*__itr).second);
1845 __o->pds__unregister();
1846 __o->pds__destroy();
1848 _OutsidePlaces.clear();
1849 for (std::map<uint32, CHandledAIGroupPD>::iterator __it=_HandledAIGroups.begin(); __it!=_HandledAIGroups.end(); )
1851 std::map<uint32, CHandledAIGroupPD>::iterator __itr=__it++;
1852 CHandledAIGroupPD* __o = &((*__itr).second);
1853 __o->pds__unregister();
1854 __o->pds__destroy();
1856 _HandledAIGroups.clear();
1858 CMissionPD* CMissionPD::cast(RY_PDS::IPDBaseData* obj)
1860 switch (obj->getTable())
1862 case 14:
1863 case 15:
1864 case 16:
1865 case 17:
1866 return static_cast<CMissionPD*>(obj);
1868 return NULL;
1870 const CMissionPD* CMissionPD::cast(const RY_PDS::IPDBaseData* obj)
1872 switch (obj->getTable())
1874 case 14:
1875 case 15:
1876 case 16:
1877 case 17:
1878 return static_cast<const CMissionPD*>(obj);
1880 return NULL;
1882 void CMissionPD::setFactory(RY_PDS::TPDFactory userFactory)
1884 pds_static__setFactory(userFactory);
1886 CMissionPD* CMissionPD::create(const uint32 &TemplateId)
1888 CMissionPD *__o = static_cast<CMissionPD*>(PDSLib.create(14));
1889 __o->pds__init(TemplateId);
1890 __o->pds__register();
1891 __o->pds__notifyInit();
1892 return __o;
1894 void CMissionPD::apply(CPersistentDataRecord &__pdr)
1896 uint16 __Tok_MapKey = __pdr.addString("__Key__");
1897 uint16 __Tok_MapVal = __pdr.addString("__Val__");
1898 uint16 __Tok_ClassName = __pdr.addString("__Class__");
1899 uint16 __TokTemplateId = __pdr.addString("TemplateId");
1900 uint16 __TokMainMissionTemplateId = __pdr.addString("MainMissionTemplateId");
1901 uint16 __TokGiver = __pdr.addString("Giver");
1902 uint16 __TokHourLowerBound = __pdr.addString("HourLowerBound");
1903 uint16 __TokHourUpperBound = __pdr.addString("HourUpperBound");
1904 uint16 __TokSeason = __pdr.addString("Season");
1905 uint16 __TokMonoEndDate = __pdr.addString("MonoEndDate");
1906 uint16 __TokEndDate = __pdr.addString("EndDate");
1907 uint16 __TokCriticalPartEndDate = __pdr.addString("CriticalPartEndDate");
1908 uint16 __TokBeginDate = __pdr.addString("BeginDate");
1909 uint16 __TokFailureIndex = __pdr.addString("FailureIndex");
1910 uint16 __TokCrashHandlerIndex = __pdr.addString("CrashHandlerIndex");
1911 uint16 __TokPlayerReconnectHandlerIndex = __pdr.addString("PlayerReconnectHandlerIndex");
1912 uint16 __TokFinished = __pdr.addString("Finished");
1913 uint16 __TokMissionSuccess = __pdr.addString("MissionSuccess");
1914 uint16 __TokDescIndex = __pdr.addString("DescIndex");
1915 uint16 __TokWaitingQueueId = __pdr.addString("WaitingQueueId");
1916 uint16 __TokSteps = __pdr.addString("Steps");
1917 uint16 __TokCompass = __pdr.addString("Compass");
1918 uint16 __TokStepsDone = __pdr.addString("StepsDone");
1919 uint16 __TokTeleports = __pdr.addString("Teleports");
1920 uint16 __TokInsidePlaces = __pdr.addString("InsidePlaces");
1921 uint16 __TokOutsidePlaces = __pdr.addString("OutsidePlaces");
1922 uint16 __TokHandledAIGroups = __pdr.addString("HandledAIGroups");
1923 _Container = NULL;
1924 while (!__pdr.isEndOfStruct())
1926 if (false) {}
1927 else if (__pdr.peekNextToken() == __TokTemplateId)
1929 __pdr.pop(__TokTemplateId, _TemplateId);
1931 else if (__pdr.peekNextToken() == __TokMainMissionTemplateId)
1933 __pdr.pop(__TokMainMissionTemplateId, _MainMissionTemplateId);
1935 else if (__pdr.peekNextToken() == __TokGiver)
1937 __pdr.pop(__TokGiver, _Giver);
1939 else if (__pdr.peekNextToken() == __TokHourLowerBound)
1941 __pdr.pop(__TokHourLowerBound, _HourLowerBound);
1943 else if (__pdr.peekNextToken() == __TokHourUpperBound)
1945 __pdr.pop(__TokHourUpperBound, _HourUpperBound);
1947 else if (__pdr.peekNextToken() == __TokSeason)
1950 std::string valuename;
1951 __pdr.pop(__TokSeason, valuename);
1952 _Season = CSeason::fromString(valuename);
1955 else if (__pdr.peekNextToken() == __TokMonoEndDate)
1957 __pdr.pop(__TokMonoEndDate, _MonoEndDate);
1959 else if (__pdr.peekNextToken() == __TokEndDate)
1961 __pdr.pop(__TokEndDate, _EndDate);
1963 else if (__pdr.peekNextToken() == __TokCriticalPartEndDate)
1965 __pdr.pop(__TokCriticalPartEndDate, _CriticalPartEndDate);
1967 else if (__pdr.peekNextToken() == __TokBeginDate)
1969 __pdr.pop(__TokBeginDate, _BeginDate);
1971 else if (__pdr.peekNextToken() == __TokFailureIndex)
1973 __pdr.pop(__TokFailureIndex, _FailureIndex);
1975 else if (__pdr.peekNextToken() == __TokCrashHandlerIndex)
1977 __pdr.pop(__TokCrashHandlerIndex, _CrashHandlerIndex);
1979 else if (__pdr.peekNextToken() == __TokPlayerReconnectHandlerIndex)
1981 __pdr.pop(__TokPlayerReconnectHandlerIndex, _PlayerReconnectHandlerIndex);
1983 else if (__pdr.peekNextToken() == __TokFinished)
1985 __pdr.pop(__TokFinished, _Finished);
1987 else if (__pdr.peekNextToken() == __TokMissionSuccess)
1989 __pdr.pop(__TokMissionSuccess, _MissionSuccess);
1991 else if (__pdr.peekNextToken() == __TokDescIndex)
1993 __pdr.pop(__TokDescIndex, _DescIndex);
1995 else if (__pdr.peekNextToken() == __TokWaitingQueueId)
1997 __pdr.pop(__TokWaitingQueueId, _WaitingQueueId);
1999 // apply Steps
2000 else if (__pdr.peekNextToken() == __TokSteps)
2002 __pdr.popStructBegin(__TokSteps);
2003 while (!__pdr.isEndOfStruct())
2005 uint32 key;
2006 __pdr.pop(__Tok_MapKey, key);
2007 __pdr.popStructBegin(__Tok_MapVal);
2008 CActiveStepPD& obj = _Steps[key];
2009 obj.apply(__pdr);
2010 obj.pds__setParentUnnotified(this);
2011 __pdr.popStructEnd(__Tok_MapVal);
2013 __pdr.popStructEnd(__TokSteps);
2015 // end of apply Steps
2016 // apply Compass
2017 else if (__pdr.peekNextToken() == __TokCompass)
2019 __pdr.popStructBegin(__TokCompass);
2020 while (!__pdr.isEndOfStruct())
2022 uint32 key;
2023 __pdr.pop(__Tok_MapKey, key);
2024 __pdr.popStructBegin(__Tok_MapVal);
2025 CMissionCompassPD& obj = _Compass[key];
2026 obj.apply(__pdr);
2027 obj.pds__setParentUnnotified(this);
2028 __pdr.popStructEnd(__Tok_MapVal);
2030 __pdr.popStructEnd(__TokCompass);
2032 // end of apply Compass
2033 // apply StepsDone
2034 else if (__pdr.peekNextToken() == __TokStepsDone)
2036 __pdr.popStructBegin(__TokStepsDone);
2037 while (!__pdr.isEndOfStruct())
2039 uint32 key;
2040 __pdr.pop(__Tok_MapKey, key);
2041 __pdr.popStructBegin(__Tok_MapVal);
2042 CDoneStepPD& obj = _StepsDone[key];
2043 obj.apply(__pdr);
2044 obj.pds__setParentUnnotified(this);
2045 __pdr.popStructEnd(__Tok_MapVal);
2047 __pdr.popStructEnd(__TokStepsDone);
2049 // end of apply StepsDone
2050 // apply Teleports
2051 else if (__pdr.peekNextToken() == __TokTeleports)
2053 __pdr.popStructBegin(__TokTeleports);
2054 while (!__pdr.isEndOfStruct())
2056 uint32 key;
2057 __pdr.pop(__Tok_MapKey, key);
2058 __pdr.popStructBegin(__Tok_MapVal);
2059 CMissionTeleportPD& obj = _Teleports[key];
2060 obj.apply(__pdr);
2061 obj.pds__setParentUnnotified(this);
2062 __pdr.popStructEnd(__Tok_MapVal);
2064 __pdr.popStructEnd(__TokTeleports);
2066 // end of apply Teleports
2067 // apply InsidePlaces
2068 else if (__pdr.peekNextToken() == __TokInsidePlaces)
2070 __pdr.popStructBegin(__TokInsidePlaces);
2071 while (!__pdr.isEndOfStruct())
2073 uint32 key;
2074 __pdr.pop(__Tok_MapKey, key);
2075 __pdr.popStructBegin(__Tok_MapVal);
2076 CMissionInsidePlacePD& obj = _InsidePlaces[key];
2077 obj.apply(__pdr);
2078 obj.pds__setParentUnnotified(this);
2079 __pdr.popStructEnd(__Tok_MapVal);
2081 __pdr.popStructEnd(__TokInsidePlaces);
2083 // end of apply InsidePlaces
2084 // apply OutsidePlaces
2085 else if (__pdr.peekNextToken() == __TokOutsidePlaces)
2087 __pdr.popStructBegin(__TokOutsidePlaces);
2088 while (!__pdr.isEndOfStruct())
2090 uint32 key;
2091 __pdr.pop(__Tok_MapKey, key);
2092 __pdr.popStructBegin(__Tok_MapVal);
2093 CMissionOutsidePlacePD& obj = _OutsidePlaces[key];
2094 obj.apply(__pdr);
2095 obj.pds__setParentUnnotified(this);
2096 __pdr.popStructEnd(__Tok_MapVal);
2098 __pdr.popStructEnd(__TokOutsidePlaces);
2100 // end of apply OutsidePlaces
2101 // apply HandledAIGroups
2102 else if (__pdr.peekNextToken() == __TokHandledAIGroups)
2104 __pdr.popStructBegin(__TokHandledAIGroups);
2105 while (!__pdr.isEndOfStruct())
2107 uint32 key;
2108 __pdr.pop(__Tok_MapKey, key);
2109 __pdr.popStructBegin(__Tok_MapVal);
2110 CHandledAIGroupPD& obj = _HandledAIGroups[key];
2111 obj.apply(__pdr);
2112 obj.pds__setParentUnnotified(this);
2113 __pdr.popStructEnd(__Tok_MapVal);
2115 __pdr.popStructEnd(__TokHandledAIGroups);
2117 // end of apply HandledAIGroups
2118 else
2120 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
2121 __pdr.skipData();
2125 void CMissionPD::store(CPersistentDataRecord &__pdr) const
2127 uint16 __Tok_MapKey = __pdr.addString("__Key__");
2128 uint16 __Tok_MapVal = __pdr.addString("__Val__");
2129 uint16 __Tok_ClassName = __pdr.addString("__Class__");
2130 uint16 __TokTemplateId = __pdr.addString("TemplateId");
2131 uint16 __TokMainMissionTemplateId = __pdr.addString("MainMissionTemplateId");
2132 uint16 __TokGiver = __pdr.addString("Giver");
2133 uint16 __TokHourLowerBound = __pdr.addString("HourLowerBound");
2134 uint16 __TokHourUpperBound = __pdr.addString("HourUpperBound");
2135 uint16 __TokSeason = __pdr.addString("Season");
2136 uint16 __TokMonoEndDate = __pdr.addString("MonoEndDate");
2137 uint16 __TokEndDate = __pdr.addString("EndDate");
2138 uint16 __TokCriticalPartEndDate = __pdr.addString("CriticalPartEndDate");
2139 uint16 __TokBeginDate = __pdr.addString("BeginDate");
2140 uint16 __TokFailureIndex = __pdr.addString("FailureIndex");
2141 uint16 __TokCrashHandlerIndex = __pdr.addString("CrashHandlerIndex");
2142 uint16 __TokPlayerReconnectHandlerIndex = __pdr.addString("PlayerReconnectHandlerIndex");
2143 uint16 __TokFinished = __pdr.addString("Finished");
2144 uint16 __TokMissionSuccess = __pdr.addString("MissionSuccess");
2145 uint16 __TokDescIndex = __pdr.addString("DescIndex");
2146 uint16 __TokWaitingQueueId = __pdr.addString("WaitingQueueId");
2147 uint16 __TokSteps = __pdr.addString("Steps");
2148 uint16 __TokCompass = __pdr.addString("Compass");
2149 uint16 __TokStepsDone = __pdr.addString("StepsDone");
2150 uint16 __TokTeleports = __pdr.addString("Teleports");
2151 uint16 __TokInsidePlaces = __pdr.addString("InsidePlaces");
2152 uint16 __TokOutsidePlaces = __pdr.addString("OutsidePlaces");
2153 uint16 __TokHandledAIGroups = __pdr.addString("HandledAIGroups");
2154 __pdr.push(__TokTemplateId, _TemplateId);
2155 __pdr.push(__TokMainMissionTemplateId, _MainMissionTemplateId);
2156 __pdr.push(__TokGiver, _Giver);
2157 __pdr.push(__TokHourLowerBound, _HourLowerBound);
2158 __pdr.push(__TokHourUpperBound, _HourUpperBound);
2160 std::string valuename = CSeason::toString(_Season);
2161 __pdr.push(__TokSeason, valuename);
2163 __pdr.push(__TokMonoEndDate, _MonoEndDate);
2164 __pdr.push(__TokEndDate, _EndDate);
2165 __pdr.push(__TokCriticalPartEndDate, _CriticalPartEndDate);
2166 __pdr.push(__TokBeginDate, _BeginDate);
2167 __pdr.push(__TokFailureIndex, _FailureIndex);
2168 __pdr.push(__TokCrashHandlerIndex, _CrashHandlerIndex);
2169 __pdr.push(__TokPlayerReconnectHandlerIndex, _PlayerReconnectHandlerIndex);
2170 __pdr.push(__TokFinished, _Finished);
2171 __pdr.push(__TokMissionSuccess, _MissionSuccess);
2172 __pdr.push(__TokDescIndex, _DescIndex);
2173 __pdr.push(__TokWaitingQueueId, _WaitingQueueId);
2174 // store Steps
2175 __pdr.pushStructBegin(__TokSteps);
2176 for (std::map<uint32, CActiveStepPD>::const_iterator it=_Steps.begin(); it!=_Steps.end(); ++it)
2178 uint32 key = (*it).first;
2179 __pdr.push(__Tok_MapKey, key);
2180 __pdr.pushStructBegin(__Tok_MapVal);
2181 (*it).second.store(__pdr);
2182 __pdr.pushStructEnd(__Tok_MapVal);
2184 __pdr.pushStructEnd(__TokSteps);
2185 // end of store Steps
2186 // store Compass
2187 __pdr.pushStructBegin(__TokCompass);
2188 for (std::map<uint32, CMissionCompassPD>::const_iterator it=_Compass.begin(); it!=_Compass.end(); ++it)
2190 uint32 key = (*it).first;
2191 __pdr.push(__Tok_MapKey, key);
2192 __pdr.pushStructBegin(__Tok_MapVal);
2193 (*it).second.store(__pdr);
2194 __pdr.pushStructEnd(__Tok_MapVal);
2196 __pdr.pushStructEnd(__TokCompass);
2197 // end of store Compass
2198 // store StepsDone
2199 __pdr.pushStructBegin(__TokStepsDone);
2200 for (std::map<uint32, CDoneStepPD>::const_iterator it=_StepsDone.begin(); it!=_StepsDone.end(); ++it)
2202 uint32 key = (*it).first;
2203 __pdr.push(__Tok_MapKey, key);
2204 __pdr.pushStructBegin(__Tok_MapVal);
2205 (*it).second.store(__pdr);
2206 __pdr.pushStructEnd(__Tok_MapVal);
2208 __pdr.pushStructEnd(__TokStepsDone);
2209 // end of store StepsDone
2210 // store Teleports
2211 __pdr.pushStructBegin(__TokTeleports);
2212 for (std::map<uint32, CMissionTeleportPD>::const_iterator it=_Teleports.begin(); it!=_Teleports.end(); ++it)
2214 uint32 key = (*it).first;
2215 __pdr.push(__Tok_MapKey, key);
2216 __pdr.pushStructBegin(__Tok_MapVal);
2217 (*it).second.store(__pdr);
2218 __pdr.pushStructEnd(__Tok_MapVal);
2220 __pdr.pushStructEnd(__TokTeleports);
2221 // end of store Teleports
2222 // store InsidePlaces
2223 __pdr.pushStructBegin(__TokInsidePlaces);
2224 for (std::map<uint32, CMissionInsidePlacePD>::const_iterator it=_InsidePlaces.begin(); it!=_InsidePlaces.end(); ++it)
2226 uint32 key = (*it).first;
2227 __pdr.push(__Tok_MapKey, key);
2228 __pdr.pushStructBegin(__Tok_MapVal);
2229 (*it).second.store(__pdr);
2230 __pdr.pushStructEnd(__Tok_MapVal);
2232 __pdr.pushStructEnd(__TokInsidePlaces);
2233 // end of store InsidePlaces
2234 // store OutsidePlaces
2235 __pdr.pushStructBegin(__TokOutsidePlaces);
2236 for (std::map<uint32, CMissionOutsidePlacePD>::const_iterator it=_OutsidePlaces.begin(); it!=_OutsidePlaces.end(); ++it)
2238 uint32 key = (*it).first;
2239 __pdr.push(__Tok_MapKey, key);
2240 __pdr.pushStructBegin(__Tok_MapVal);
2241 (*it).second.store(__pdr);
2242 __pdr.pushStructEnd(__Tok_MapVal);
2244 __pdr.pushStructEnd(__TokOutsidePlaces);
2245 // end of store OutsidePlaces
2246 // store HandledAIGroups
2247 __pdr.pushStructBegin(__TokHandledAIGroups);
2248 for (std::map<uint32, CHandledAIGroupPD>::const_iterator it=_HandledAIGroups.begin(); it!=_HandledAIGroups.end(); ++it)
2250 uint32 key = (*it).first;
2251 __pdr.push(__Tok_MapKey, key);
2252 __pdr.pushStructBegin(__Tok_MapVal);
2253 (*it).second.store(__pdr);
2254 __pdr.pushStructEnd(__Tok_MapVal);
2256 __pdr.pushStructEnd(__TokHandledAIGroups);
2257 // end of store HandledAIGroups
2259 void CMissionPD::init()
2262 void CMissionPD::release()
2265 void CMissionPD::pds__init(const uint32 &TemplateId)
2267 _TemplateId = TemplateId;
2268 _MainMissionTemplateId = 0;
2269 _Giver = 0;
2270 _HourLowerBound = 0.0f;
2271 _HourUpperBound = 0.0f;
2272 _Season = (CSeason::TSeason)0;
2273 _MonoEndDate = 0;
2274 _EndDate = 0;
2275 _CriticalPartEndDate = 0;
2276 _BeginDate = 0;
2277 _FailureIndex = 0;
2278 _CrashHandlerIndex = 0xFFFFFFFF;
2279 _PlayerReconnectHandlerIndex = 0xFFFFFFFF;
2280 _Finished = false;
2281 _MissionSuccess = true;
2282 _DescIndex = 0;
2283 _WaitingQueueId = 0;
2284 _Container = NULL;
2286 void CMissionPD::pds__destroy()
2288 for (std::map<uint32, CActiveStepPD>::iterator __it=_Steps.begin(); __it!=_Steps.end(); )
2290 std::map<uint32, CActiveStepPD>::iterator __itr=__it++;
2291 ((*__itr).second).pds__destroy();
2293 _Steps.clear();
2294 for (std::map<uint32, CMissionCompassPD>::iterator __it=_Compass.begin(); __it!=_Compass.end(); )
2296 std::map<uint32, CMissionCompassPD>::iterator __itr=__it++;
2297 ((*__itr).second).pds__destroy();
2299 _Compass.clear();
2300 for (std::map<uint32, CDoneStepPD>::iterator __it=_StepsDone.begin(); __it!=_StepsDone.end(); )
2302 std::map<uint32, CDoneStepPD>::iterator __itr=__it++;
2303 ((*__itr).second).pds__destroy();
2305 _StepsDone.clear();
2306 for (std::map<uint32, CMissionTeleportPD>::iterator __it=_Teleports.begin(); __it!=_Teleports.end(); )
2308 std::map<uint32, CMissionTeleportPD>::iterator __itr=__it++;
2309 ((*__itr).second).pds__destroy();
2311 _Teleports.clear();
2312 for (std::map<uint32, CMissionInsidePlacePD>::iterator __it=_InsidePlaces.begin(); __it!=_InsidePlaces.end(); )
2314 std::map<uint32, CMissionInsidePlacePD>::iterator __itr=__it++;
2315 ((*__itr).second).pds__destroy();
2317 _InsidePlaces.clear();
2318 for (std::map<uint32, CMissionOutsidePlacePD>::iterator __it=_OutsidePlaces.begin(); __it!=_OutsidePlaces.end(); )
2320 std::map<uint32, CMissionOutsidePlacePD>::iterator __itr=__it++;
2321 ((*__itr).second).pds__destroy();
2323 _OutsidePlaces.clear();
2324 for (std::map<uint32, CHandledAIGroupPD>::iterator __it=_HandledAIGroups.begin(); __it!=_HandledAIGroups.end(); )
2326 std::map<uint32, CHandledAIGroupPD>::iterator __itr=__it++;
2327 ((*__itr).second).pds__destroy();
2329 _HandledAIGroups.clear();
2331 void CMissionPD::pds__fetch(RY_PDS::CPData &data)
2333 data.serial(_TemplateId);
2334 data.serial(_MainMissionTemplateId);
2335 data.serial(_Giver);
2336 data.serial(_HourLowerBound);
2337 data.serial(_HourUpperBound);
2338 data.serialEnum(_Season);
2339 data.serial(_MonoEndDate);
2340 data.serial(_EndDate);
2341 data.serial(_CriticalPartEndDate);
2342 data.serial(_BeginDate);
2343 data.serial(_FailureIndex);
2344 data.serial(_CrashHandlerIndex);
2345 data.serial(_PlayerReconnectHandlerIndex);
2346 data.serial(_Finished);
2347 data.serial(_MissionSuccess);
2348 data.serial(_DescIndex);
2349 data.serial(_WaitingQueueId);
2350 RY_PDS::TTableIndex tableIndex;
2351 RY_PDS::TRowIndex rowIndex;
2354 // read table and row, create an object, affect to the ref, and fetch it
2355 data.serial(tableIndex, rowIndex);
2356 if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break;
2357 uint32 __k;
2358 data.serial(__k);
2359 _Steps.insert(std::pair<uint32,CActiveStepPD>(__k, CActiveStepPD()));
2360 CActiveStepPD* __o = &(_Steps[__k]);
2361 PDSLib.setRowIndex(rowIndex, __o);
2362 __o->pds__fetch(data);
2363 __o->pds__setParentUnnotified(this);
2365 while (true);
2368 // read table and row, create an object, affect to the ref, and fetch it
2369 data.serial(tableIndex, rowIndex);
2370 if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break;
2371 uint32 __k;
2372 data.serial(__k);
2373 _Compass.insert(std::pair<uint32,CMissionCompassPD>(__k, CMissionCompassPD()));
2374 CMissionCompassPD* __o = &(_Compass[__k]);
2375 PDSLib.setRowIndex(rowIndex, __o);
2376 __o->pds__fetch(data);
2377 __o->pds__setParentUnnotified(this);
2379 while (true);
2382 // read table and row, create an object, affect to the ref, and fetch it
2383 data.serial(tableIndex, rowIndex);
2384 if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break;
2385 uint32 __k;
2386 data.serial(__k);
2387 _StepsDone.insert(std::pair<uint32,CDoneStepPD>(__k, CDoneStepPD()));
2388 CDoneStepPD* __o = &(_StepsDone[__k]);
2389 PDSLib.setRowIndex(rowIndex, __o);
2390 __o->pds__fetch(data);
2391 __o->pds__setParentUnnotified(this);
2393 while (true);
2396 // read table and row, create an object, affect to the ref, and fetch it
2397 data.serial(tableIndex, rowIndex);
2398 if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break;
2399 uint32 __k;
2400 data.serial(__k);
2401 _Teleports.insert(std::pair<uint32,CMissionTeleportPD>(__k, CMissionTeleportPD()));
2402 CMissionTeleportPD* __o = &(_Teleports[__k]);
2403 PDSLib.setRowIndex(rowIndex, __o);
2404 __o->pds__fetch(data);
2405 __o->pds__setParentUnnotified(this);
2407 while (true);
2410 // read table and row, create an object, affect to the ref, and fetch it
2411 data.serial(tableIndex, rowIndex);
2412 if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break;
2413 uint32 __k;
2414 data.serial(__k);
2415 _InsidePlaces.insert(std::pair<uint32,CMissionInsidePlacePD>(__k, CMissionInsidePlacePD()));
2416 CMissionInsidePlacePD* __o = &(_InsidePlaces[__k]);
2417 PDSLib.setRowIndex(rowIndex, __o);
2418 __o->pds__fetch(data);
2419 __o->pds__setParentUnnotified(this);
2421 while (true);
2424 // read table and row, create an object, affect to the ref, and fetch it
2425 data.serial(tableIndex, rowIndex);
2426 if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break;
2427 uint32 __k;
2428 data.serial(__k);
2429 _OutsidePlaces.insert(std::pair<uint32,CMissionOutsidePlacePD>(__k, CMissionOutsidePlacePD()));
2430 CMissionOutsidePlacePD* __o = &(_OutsidePlaces[__k]);
2431 PDSLib.setRowIndex(rowIndex, __o);
2432 __o->pds__fetch(data);
2433 __o->pds__setParentUnnotified(this);
2435 while (true);
2438 // read table and row, create an object, affect to the ref, and fetch it
2439 data.serial(tableIndex, rowIndex);
2440 if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break;
2441 uint32 __k;
2442 data.serial(__k);
2443 _HandledAIGroups.insert(std::pair<uint32,CHandledAIGroupPD>(__k, CHandledAIGroupPD()));
2444 CHandledAIGroupPD* __o = &(_HandledAIGroups[__k]);
2445 PDSLib.setRowIndex(rowIndex, __o);
2446 __o->pds__fetch(data);
2447 __o->pds__setParentUnnotified(this);
2449 while (true);
2450 _Container = NULL;
2452 void CMissionPD::pds__register()
2454 __BaseRow = _IndexAllocator.allocate();
2455 PDSLib.allocateRow(__BaseTable, __BaseRow, 0);
2456 pds__registerAttributes();
2458 void CMissionPD::pds__registerAttributes()
2460 if (RY_PDS::PDVerbose) nldebug("CMissionPD: registerAttributes %u:%u", __BaseTable, __BaseRow);
2461 PDSLib.set(__BaseTable, __BaseRow, (RY_PDS::TColumnIndex)(0), _TemplateId);
2463 void CMissionPD::pds__unregister()
2465 pds__unregisterAttributes();
2466 PDSLib.deallocateRow(__BaseTable, __BaseRow);
2467 _IndexAllocator.deallocate(__BaseRow);
2469 void CMissionPD::pds__unregisterAttributes()
2471 if (RY_PDS::PDVerbose) nldebug("CMissionPD: unregisterAttributes %u:%u", __BaseTable, __BaseRow);
2472 pds__setParent(NULL);
2473 for (std::map<uint32, CActiveStepPD>::iterator __it=_Steps.begin(); __it!=_Steps.end(); )
2475 std::map<uint32, CActiveStepPD>::iterator __itr=__it++;
2476 CActiveStepPD& __o = (*__itr).second;
2477 __o.pds__unregister();
2479 for (std::map<uint32, CMissionCompassPD>::iterator __it=_Compass.begin(); __it!=_Compass.end(); )
2481 std::map<uint32, CMissionCompassPD>::iterator __itr=__it++;
2482 CMissionCompassPD& __o = (*__itr).second;
2483 __o.pds__unregister();
2485 for (std::map<uint32, CDoneStepPD>::iterator __it=_StepsDone.begin(); __it!=_StepsDone.end(); )
2487 std::map<uint32, CDoneStepPD>::iterator __itr=__it++;
2488 CDoneStepPD& __o = (*__itr).second;
2489 __o.pds__unregister();
2491 for (std::map<uint32, CMissionTeleportPD>::iterator __it=_Teleports.begin(); __it!=_Teleports.end(); )
2493 std::map<uint32, CMissionTeleportPD>::iterator __itr=__it++;
2494 CMissionTeleportPD& __o = (*__itr).second;
2495 __o.pds__unregister();
2497 for (std::map<uint32, CMissionInsidePlacePD>::iterator __it=_InsidePlaces.begin(); __it!=_InsidePlaces.end(); )
2499 std::map<uint32, CMissionInsidePlacePD>::iterator __itr=__it++;
2500 CMissionInsidePlacePD& __o = (*__itr).second;
2501 __o.pds__unregister();
2503 for (std::map<uint32, CMissionOutsidePlacePD>::iterator __it=_OutsidePlaces.begin(); __it!=_OutsidePlaces.end(); )
2505 std::map<uint32, CMissionOutsidePlacePD>::iterator __itr=__it++;
2506 CMissionOutsidePlacePD& __o = (*__itr).second;
2507 __o.pds__unregister();
2509 for (std::map<uint32, CHandledAIGroupPD>::iterator __it=_HandledAIGroups.begin(); __it!=_HandledAIGroups.end(); )
2511 std::map<uint32, CHandledAIGroupPD>::iterator __itr=__it++;
2512 CHandledAIGroupPD& __o = (*__itr).second;
2513 __o.pds__unregister();
2516 void CMissionPD::pds__setParent(CMissionContainerPD* __parent)
2518 NLMISC::CEntityId prevId;
2519 if (_Container != NULL)
2521 prevId = _Container->getCharId();
2522 _Container->pds__unlinkMissions(_TemplateId);
2524 _Container = __parent;
2525 PDSLib.setParent(__BaseTable, getRow(), (RY_PDS::TColumnIndex)(24), (__parent != NULL ? RY_PDS::CObjectIndex(18, __parent->getRow()) : RY_PDS::CObjectIndex::null()), (_Container != NULL ? _Container->getCharId() : NLMISC::CEntityId::Unknown), prevId);
2527 void CMissionPD::pds__setParentUnnotified(CMissionContainerPD* __parent)
2529 _Container = __parent;
2531 void CMissionPD::pds__notifyInit()
2533 init();
2535 // CMissionPD init user code, defined at entities_game_service/pd_scripts/mission.pds:75
2536 _Mission = this;
2538 for (std::map<uint32, CActiveStepPD>::iterator __it=_Steps.begin(); __it!=_Steps.end(); )
2540 std::map<uint32, CActiveStepPD>::iterator __itr=__it++;
2541 (*__itr).second.pds__notifyInit();
2543 for (std::map<uint32, CMissionCompassPD>::iterator __it=_Compass.begin(); __it!=_Compass.end(); )
2545 std::map<uint32, CMissionCompassPD>::iterator __itr=__it++;
2546 (*__itr).second.pds__notifyInit();
2548 for (std::map<uint32, CDoneStepPD>::iterator __it=_StepsDone.begin(); __it!=_StepsDone.end(); )
2550 std::map<uint32, CDoneStepPD>::iterator __itr=__it++;
2551 (*__itr).second.pds__notifyInit();
2553 for (std::map<uint32, CMissionTeleportPD>::iterator __it=_Teleports.begin(); __it!=_Teleports.end(); )
2555 std::map<uint32, CMissionTeleportPD>::iterator __itr=__it++;
2556 (*__itr).second.pds__notifyInit();
2558 for (std::map<uint32, CMissionInsidePlacePD>::iterator __it=_InsidePlaces.begin(); __it!=_InsidePlaces.end(); )
2560 std::map<uint32, CMissionInsidePlacePD>::iterator __itr=__it++;
2561 (*__itr).second.pds__notifyInit();
2563 for (std::map<uint32, CMissionOutsidePlacePD>::iterator __it=_OutsidePlaces.begin(); __it!=_OutsidePlaces.end(); )
2565 std::map<uint32, CMissionOutsidePlacePD>::iterator __itr=__it++;
2566 (*__itr).second.pds__notifyInit();
2568 for (std::map<uint32, CHandledAIGroupPD>::iterator __it=_HandledAIGroups.begin(); __it!=_HandledAIGroups.end(); )
2570 std::map<uint32, CHandledAIGroupPD>::iterator __itr=__it++;
2571 (*__itr).second.pds__notifyInit();
2574 void CMissionPD::pds__notifyRelease()
2576 release();
2577 PDSLib.release(__BaseTable, __BaseRow);
2578 for (std::map<uint32, CActiveStepPD>::iterator __it=_Steps.begin(); __it!=_Steps.end(); )
2580 std::map<uint32, CActiveStepPD>::iterator __itr=__it++;
2581 (*__itr).second.pds__notifyRelease();
2583 for (std::map<uint32, CMissionCompassPD>::iterator __it=_Compass.begin(); __it!=_Compass.end(); )
2585 std::map<uint32, CMissionCompassPD>::iterator __itr=__it++;
2586 (*__itr).second.pds__notifyRelease();
2588 for (std::map<uint32, CDoneStepPD>::iterator __it=_StepsDone.begin(); __it!=_StepsDone.end(); )
2590 std::map<uint32, CDoneStepPD>::iterator __itr=__it++;
2591 (*__itr).second.pds__notifyRelease();
2593 for (std::map<uint32, CMissionTeleportPD>::iterator __it=_Teleports.begin(); __it!=_Teleports.end(); )
2595 std::map<uint32, CMissionTeleportPD>::iterator __itr=__it++;
2596 (*__itr).second.pds__notifyRelease();
2598 for (std::map<uint32, CMissionInsidePlacePD>::iterator __it=_InsidePlaces.begin(); __it!=_InsidePlaces.end(); )
2600 std::map<uint32, CMissionInsidePlacePD>::iterator __itr=__it++;
2601 (*__itr).second.pds__notifyRelease();
2603 for (std::map<uint32, CMissionOutsidePlacePD>::iterator __it=_OutsidePlaces.begin(); __it!=_OutsidePlaces.end(); )
2605 std::map<uint32, CMissionOutsidePlacePD>::iterator __itr=__it++;
2606 (*__itr).second.pds__notifyRelease();
2608 for (std::map<uint32, CHandledAIGroupPD>::iterator __it=_HandledAIGroups.begin(); __it!=_HandledAIGroups.end(); )
2610 std::map<uint32, CHandledAIGroupPD>::iterator __itr=__it++;
2611 (*__itr).second.pds__notifyRelease();
2614 void CMissionPD::pds_static__init()
2616 PDSLib.setIndexAllocator(14, _IndexAllocator);
2617 nlassertex(_FactoryInitialised, ("User Factory for class CMissionPD not set!"));
2618 // factory must have been set by user before database init called!
2619 // You must provide a factory for the class CMissionPD as it is marked as derived
2620 // Call EGSPD::CMissionPD::setFactory() with a factory before any call to EGSPD::init()!
2622 void CMissionPD::pds_static__setFactory(RY_PDS::TPDFactory userFactory)
2624 if (!_FactoryInitialised)
2626 PDSLib.registerClass(14, userFactory, pds_static__fetch, NULL);
2627 _FactoryInitialised = true;
2630 bool CMissionPD::_FactoryInitialised;
2631 RY_PDS::CIndexAllocator CMissionPD::_IndexAllocator;
2632 void CMissionPD::pds_static__fetch(RY_PDS::IPDBaseData *object, RY_PDS::CPData &data)
2634 CMissionPD *__o = static_cast<CMissionPD*>(object);
2635 __o->pds__fetch(data);
2636 __o->pds__notifyInit();
2638 // End of static implementation of CMissionPD
2640 /* -----------------------------------------
2641 * Static Implementation of CMissionGuildPD
2642 * ----------------------------------------- */
2643 void CMissionGuildPD::clear()
2645 CMissionPD::clear();
2647 CMissionGuildPD* CMissionGuildPD::cast(RY_PDS::IPDBaseData* obj)
2649 return (obj->getTable() == 15) ? static_cast<CMissionGuildPD*>(obj) : NULL;
2651 const CMissionGuildPD* CMissionGuildPD::cast(const RY_PDS::IPDBaseData* obj)
2653 return (obj->getTable() == 15) ? static_cast<const CMissionGuildPD*>(obj) : NULL;
2655 void CMissionGuildPD::setFactory(RY_PDS::TPDFactory userFactory)
2657 pds_static__setFactory(userFactory);
2659 CMissionGuildPD* CMissionGuildPD::create(const uint32 &TemplateId)
2661 CMissionGuildPD *__o = static_cast<CMissionGuildPD*>(PDSLib.create(15));
2662 __o->pds__init(TemplateId);
2663 __o->pds__register();
2664 __o->pds__notifyInit();
2665 return __o;
2667 void CMissionGuildPD::apply(CPersistentDataRecord &__pdr)
2669 uint16 __Tok_MapKey = __pdr.addString("__Key__");
2670 uint16 __Tok_MapVal = __pdr.addString("__Val__");
2671 uint16 __Tok_ClassName = __pdr.addString("__Class__");
2672 uint16 __Tok_Parent = __pdr.addString("__Parent__");
2673 while (!__pdr.isEndOfStruct())
2675 if (false) {}
2676 else if (__pdr.peekNextToken() == __Tok_Parent)
2678 __pdr.popStructBegin(__Tok_Parent);
2679 CMissionPD::apply(__pdr);
2680 __pdr.popStructEnd(__Tok_Parent);
2682 else
2684 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
2685 __pdr.skipData();
2689 void CMissionGuildPD::store(CPersistentDataRecord &__pdr) const
2691 uint16 __Tok_MapKey = __pdr.addString("__Key__");
2692 uint16 __Tok_MapVal = __pdr.addString("__Val__");
2693 uint16 __Tok_ClassName = __pdr.addString("__Class__");
2694 uint16 __Tok_Parent = __pdr.addString("__Parent__");
2695 __pdr.pushStructBegin(__Tok_Parent);
2696 CMissionPD::store(__pdr);
2697 __pdr.pushStructEnd(__Tok_Parent);
2699 void CMissionGuildPD::init()
2702 void CMissionGuildPD::release()
2705 void CMissionGuildPD::pds__init(const uint32 &TemplateId)
2707 CMissionPD::pds__init(TemplateId);
2709 void CMissionGuildPD::pds__destroy()
2711 CMissionPD::pds__destroy();
2713 void CMissionGuildPD::pds__fetch(RY_PDS::CPData &data)
2715 CMissionPD::pds__fetch(data);
2717 void CMissionGuildPD::pds__register()
2719 __BaseRow = _IndexAllocator.allocate();
2720 PDSLib.allocateRow(__BaseTable, __BaseRow, 0);
2721 pds__registerAttributes();
2723 void CMissionGuildPD::pds__registerAttributes()
2725 if (RY_PDS::PDVerbose) nldebug("CMissionGuildPD: registerAttributes %u:%u", __BaseTable, __BaseRow);
2726 CMissionPD::pds__registerAttributes();
2728 void CMissionGuildPD::pds__unregister()
2730 pds__unregisterAttributes();
2731 PDSLib.deallocateRow(__BaseTable, __BaseRow);
2732 _IndexAllocator.deallocate(__BaseRow);
2734 void CMissionGuildPD::pds__unregisterAttributes()
2736 if (RY_PDS::PDVerbose) nldebug("CMissionGuildPD: unregisterAttributes %u:%u", __BaseTable, __BaseRow);
2737 CMissionPD::pds__unregisterAttributes();
2739 void CMissionGuildPD::pds__notifyInit()
2741 CMissionPD::pds__notifyInit();
2742 init();
2744 void CMissionGuildPD::pds__notifyRelease()
2746 release();
2747 CMissionPD::pds__notifyRelease();
2749 void CMissionGuildPD::pds_static__init()
2751 PDSLib.setIndexAllocator(15, _IndexAllocator);
2752 nlassertex(_FactoryInitialised, ("User Factory for class CMissionGuildPD not set!"));
2753 // factory must have been set by user before database init called!
2754 // You must provide a factory for the class CMissionGuildPD as it is marked as derived
2755 // Call EGSPD::CMissionGuildPD::setFactory() with a factory before any call to EGSPD::init()!
2757 void CMissionGuildPD::pds_static__setFactory(RY_PDS::TPDFactory userFactory)
2759 if (!_FactoryInitialised)
2761 PDSLib.registerClass(15, userFactory, pds_static__fetch, NULL);
2762 _FactoryInitialised = true;
2765 bool CMissionGuildPD::_FactoryInitialised;
2766 RY_PDS::CIndexAllocator CMissionGuildPD::_IndexAllocator;
2767 // End of static implementation of CMissionGuildPD
2769 /* -----------------------------------------
2770 * Static Implementation of CMissionTeamPD
2771 * ----------------------------------------- */
2772 void CMissionTeamPD::clear()
2774 CMissionPD::clear();
2776 CMissionTeamPD* CMissionTeamPD::cast(RY_PDS::IPDBaseData* obj)
2778 return (obj->getTable() == 16) ? static_cast<CMissionTeamPD*>(obj) : NULL;
2780 const CMissionTeamPD* CMissionTeamPD::cast(const RY_PDS::IPDBaseData* obj)
2782 return (obj->getTable() == 16) ? static_cast<const CMissionTeamPD*>(obj) : NULL;
2784 void CMissionTeamPD::setFactory(RY_PDS::TPDFactory userFactory)
2786 pds_static__setFactory(userFactory);
2788 CMissionTeamPD* CMissionTeamPD::create(const uint32 &TemplateId)
2790 CMissionTeamPD *__o = static_cast<CMissionTeamPD*>(PDSLib.create(16));
2791 __o->pds__init(TemplateId);
2792 __o->pds__register();
2793 __o->pds__notifyInit();
2794 return __o;
2796 void CMissionTeamPD::apply(CPersistentDataRecord &__pdr)
2798 uint16 __Tok_MapKey = __pdr.addString("__Key__");
2799 uint16 __Tok_MapVal = __pdr.addString("__Val__");
2800 uint16 __Tok_ClassName = __pdr.addString("__Class__");
2801 uint16 __Tok_Parent = __pdr.addString("__Parent__");
2802 while (!__pdr.isEndOfStruct())
2804 if (false) {}
2805 else if (__pdr.peekNextToken() == __Tok_Parent)
2807 __pdr.popStructBegin(__Tok_Parent);
2808 CMissionPD::apply(__pdr);
2809 __pdr.popStructEnd(__Tok_Parent);
2811 else
2813 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
2814 __pdr.skipData();
2818 void CMissionTeamPD::store(CPersistentDataRecord &__pdr) const
2820 uint16 __Tok_MapKey = __pdr.addString("__Key__");
2821 uint16 __Tok_MapVal = __pdr.addString("__Val__");
2822 uint16 __Tok_ClassName = __pdr.addString("__Class__");
2823 uint16 __Tok_Parent = __pdr.addString("__Parent__");
2824 __pdr.pushStructBegin(__Tok_Parent);
2825 CMissionPD::store(__pdr);
2826 __pdr.pushStructEnd(__Tok_Parent);
2828 void CMissionTeamPD::init()
2831 void CMissionTeamPD::release()
2834 void CMissionTeamPD::pds__init(const uint32 &TemplateId)
2836 CMissionPD::pds__init(TemplateId);
2838 void CMissionTeamPD::pds__destroy()
2840 CMissionPD::pds__destroy();
2842 void CMissionTeamPD::pds__fetch(RY_PDS::CPData &data)
2844 CMissionPD::pds__fetch(data);
2846 void CMissionTeamPD::pds__register()
2848 __BaseRow = _IndexAllocator.allocate();
2849 PDSLib.allocateRow(__BaseTable, __BaseRow, 0);
2850 pds__registerAttributes();
2852 void CMissionTeamPD::pds__registerAttributes()
2854 if (RY_PDS::PDVerbose) nldebug("CMissionTeamPD: registerAttributes %u:%u", __BaseTable, __BaseRow);
2855 CMissionPD::pds__registerAttributes();
2857 void CMissionTeamPD::pds__unregister()
2859 pds__unregisterAttributes();
2860 PDSLib.deallocateRow(__BaseTable, __BaseRow);
2861 _IndexAllocator.deallocate(__BaseRow);
2863 void CMissionTeamPD::pds__unregisterAttributes()
2865 if (RY_PDS::PDVerbose) nldebug("CMissionTeamPD: unregisterAttributes %u:%u", __BaseTable, __BaseRow);
2866 CMissionPD::pds__unregisterAttributes();
2868 void CMissionTeamPD::pds__notifyInit()
2870 CMissionPD::pds__notifyInit();
2871 init();
2873 void CMissionTeamPD::pds__notifyRelease()
2875 release();
2876 CMissionPD::pds__notifyRelease();
2878 void CMissionTeamPD::pds_static__init()
2880 PDSLib.setIndexAllocator(16, _IndexAllocator);
2881 nlassertex(_FactoryInitialised, ("User Factory for class CMissionTeamPD not set!"));
2882 // factory must have been set by user before database init called!
2883 // You must provide a factory for the class CMissionTeamPD as it is marked as derived
2884 // Call EGSPD::CMissionTeamPD::setFactory() with a factory before any call to EGSPD::init()!
2886 void CMissionTeamPD::pds_static__setFactory(RY_PDS::TPDFactory userFactory)
2888 if (!_FactoryInitialised)
2890 PDSLib.registerClass(16, userFactory, pds_static__fetch, NULL);
2891 _FactoryInitialised = true;
2894 bool CMissionTeamPD::_FactoryInitialised;
2895 RY_PDS::CIndexAllocator CMissionTeamPD::_IndexAllocator;
2896 // End of static implementation of CMissionTeamPD
2898 /* -----------------------------------------
2899 * Static Implementation of CMissionSoloPD
2900 * ----------------------------------------- */
2901 void CMissionSoloPD::clear()
2903 CMissionPD::clear();
2905 CMissionSoloPD* CMissionSoloPD::cast(RY_PDS::IPDBaseData* obj)
2907 return (obj->getTable() == 17) ? static_cast<CMissionSoloPD*>(obj) : NULL;
2909 const CMissionSoloPD* CMissionSoloPD::cast(const RY_PDS::IPDBaseData* obj)
2911 return (obj->getTable() == 17) ? static_cast<const CMissionSoloPD*>(obj) : NULL;
2913 void CMissionSoloPD::setFactory(RY_PDS::TPDFactory userFactory)
2915 pds_static__setFactory(userFactory);
2917 CMissionSoloPD* CMissionSoloPD::create(const uint32 &TemplateId)
2919 CMissionSoloPD *__o = static_cast<CMissionSoloPD*>(PDSLib.create(17));
2920 __o->pds__init(TemplateId);
2921 __o->pds__register();
2922 __o->pds__notifyInit();
2923 return __o;
2925 void CMissionSoloPD::apply(CPersistentDataRecord &__pdr)
2927 uint16 __Tok_MapKey = __pdr.addString("__Key__");
2928 uint16 __Tok_MapVal = __pdr.addString("__Val__");
2929 uint16 __Tok_ClassName = __pdr.addString("__Class__");
2930 uint16 __Tok_Parent = __pdr.addString("__Parent__");
2931 while (!__pdr.isEndOfStruct())
2933 if (false) {}
2934 else if (__pdr.peekNextToken() == __Tok_Parent)
2936 __pdr.popStructBegin(__Tok_Parent);
2937 CMissionPD::apply(__pdr);
2938 __pdr.popStructEnd(__Tok_Parent);
2940 else
2942 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
2943 __pdr.skipData();
2947 void CMissionSoloPD::store(CPersistentDataRecord &__pdr) const
2949 uint16 __Tok_MapKey = __pdr.addString("__Key__");
2950 uint16 __Tok_MapVal = __pdr.addString("__Val__");
2951 uint16 __Tok_ClassName = __pdr.addString("__Class__");
2952 uint16 __Tok_Parent = __pdr.addString("__Parent__");
2953 __pdr.pushStructBegin(__Tok_Parent);
2954 CMissionPD::store(__pdr);
2955 __pdr.pushStructEnd(__Tok_Parent);
2957 void CMissionSoloPD::init()
2960 void CMissionSoloPD::release()
2963 void CMissionSoloPD::pds__init(const uint32 &TemplateId)
2965 CMissionPD::pds__init(TemplateId);
2967 void CMissionSoloPD::pds__destroy()
2969 CMissionPD::pds__destroy();
2971 void CMissionSoloPD::pds__fetch(RY_PDS::CPData &data)
2973 CMissionPD::pds__fetch(data);
2975 void CMissionSoloPD::pds__register()
2977 __BaseRow = _IndexAllocator.allocate();
2978 PDSLib.allocateRow(__BaseTable, __BaseRow, 0);
2979 pds__registerAttributes();
2981 void CMissionSoloPD::pds__registerAttributes()
2983 if (RY_PDS::PDVerbose) nldebug("CMissionSoloPD: registerAttributes %u:%u", __BaseTable, __BaseRow);
2984 CMissionPD::pds__registerAttributes();
2986 void CMissionSoloPD::pds__unregister()
2988 pds__unregisterAttributes();
2989 PDSLib.deallocateRow(__BaseTable, __BaseRow);
2990 _IndexAllocator.deallocate(__BaseRow);
2992 void CMissionSoloPD::pds__unregisterAttributes()
2994 if (RY_PDS::PDVerbose) nldebug("CMissionSoloPD: unregisterAttributes %u:%u", __BaseTable, __BaseRow);
2995 CMissionPD::pds__unregisterAttributes();
2997 void CMissionSoloPD::pds__notifyInit()
2999 CMissionPD::pds__notifyInit();
3000 init();
3002 void CMissionSoloPD::pds__notifyRelease()
3004 release();
3005 CMissionPD::pds__notifyRelease();
3007 void CMissionSoloPD::pds_static__init()
3009 PDSLib.setIndexAllocator(17, _IndexAllocator);
3010 nlassertex(_FactoryInitialised, ("User Factory for class CMissionSoloPD not set!"));
3011 // factory must have been set by user before database init called!
3012 // You must provide a factory for the class CMissionSoloPD as it is marked as derived
3013 // Call EGSPD::CMissionSoloPD::setFactory() with a factory before any call to EGSPD::init()!
3015 void CMissionSoloPD::pds_static__setFactory(RY_PDS::TPDFactory userFactory)
3017 if (!_FactoryInitialised)
3019 PDSLib.registerClass(17, userFactory, pds_static__fetch, NULL);
3020 _FactoryInitialised = true;
3023 bool CMissionSoloPD::_FactoryInitialised;
3024 RY_PDS::CIndexAllocator CMissionSoloPD::_IndexAllocator;
3025 // End of static implementation of CMissionSoloPD
3027 /* -----------------------------------------
3028 * Static Implementation of CMissionContainerPD
3029 * ----------------------------------------- */
3030 NLMISC::CEntityId CMissionContainerPD::getCharId() const
3032 return _CharId;
3034 CMissionPD* CMissionContainerPD::getMissions(const uint32& __k)
3036 std::map<uint32, CMissionPD*>::iterator _it = _Missions.find(__k);
3037 return (_it==_Missions.end() ? NULL : (*_it).second);
3039 const CMissionPD* CMissionContainerPD::getMissions(const uint32& __k) const
3041 std::map<uint32, CMissionPD*>::const_iterator _it = _Missions.find(__k);
3042 return (_it==_Missions.end() ? NULL : (*_it).second);
3044 std::map<uint32, CMissionPD*>::iterator CMissionContainerPD::getMissionsBegin()
3046 return _Missions.begin();
3048 std::map<uint32, CMissionPD*>::iterator CMissionContainerPD::getMissionsEnd()
3050 return _Missions.end();
3052 std::map<uint32, CMissionPD*>::const_iterator CMissionContainerPD::getMissionsBegin() const
3054 return _Missions.begin();
3056 std::map<uint32, CMissionPD*>::const_iterator CMissionContainerPD::getMissionsEnd() const
3058 return _Missions.end();
3060 const std::map<uint32, CMissionPD*> & CMissionContainerPD::getMissions() const
3062 return _Missions;
3064 void CMissionContainerPD::setMissions(CMissionPD* __v)
3066 if (__v == NULL) return;
3067 uint32 __k = __v->getTemplateId();
3068 std::map<uint32, CMissionPD*>::iterator _it = _Missions.find(__k);
3069 if (_it != _Missions.end())
3071 CMissionPD* __prev = (*_it).second;
3072 if (__prev == __v) return;
3073 __prev->pds__setParent(NULL);
3074 __prev->pds__unregister();
3075 __prev->pds__destroy();
3076 delete __prev;
3078 __v->pds__setParent(this);
3079 _Missions[__k] = __v;
3081 void CMissionContainerPD::deleteFromMissions(const uint32 &__k)
3083 std::map<uint32, CMissionPD*>::iterator __it = _Missions.find(__k);
3084 if (__it == _Missions.end()) return;
3085 CMissionPD* __o = (*__it).second;
3086 __o->pds__unregister();
3087 __o->pds__destroy();
3088 delete __o;
3090 void CMissionContainerPD::clear()
3092 for (std::map<uint32, CMissionPD*>::iterator __it=_Missions.begin(); __it!=_Missions.end(); )
3094 std::map<uint32, CMissionPD*>::iterator __itr=__it++;
3095 CMissionPD* __o = (*__itr).second;
3096 __o->pds__unregister();
3097 __o->pds__destroy();
3098 delete __o;
3100 _Missions.clear();
3102 CMissionContainerPD* CMissionContainerPD::cast(RY_PDS::IPDBaseData* obj)
3104 return (obj->getTable() == 18) ? static_cast<CMissionContainerPD*>(obj) : NULL;
3106 const CMissionContainerPD* CMissionContainerPD::cast(const RY_PDS::IPDBaseData* obj)
3108 return (obj->getTable() == 18) ? static_cast<const CMissionContainerPD*>(obj) : NULL;
3110 CMissionContainerPD* CMissionContainerPD::create(const NLMISC::CEntityId &CharId)
3112 CMissionContainerPD *__o = static_cast<CMissionContainerPD*>(pds_static__factory());
3113 __o->pds__init(CharId);
3114 __o->pds__register();
3115 __o->pds__notifyInit();
3116 return __o;
3118 void CMissionContainerPD::remove(const NLMISC::CEntityId& CharId)
3120 std::map<NLMISC::CEntityId,CMissionContainerPD*>::iterator it = _Map.find(CharId);
3121 if (it != _Map.end())
3123 CMissionContainerPD* __o = (*it).second;
3124 __o->pds__notifyRelease();
3125 __o->pds__unregister();
3126 __o->pds__destroy();
3127 delete __o;
3130 void CMissionContainerPD::load(const NLMISC::CEntityId& CharId)
3132 PDSLib.load(18, CharId.asUint64());
3134 void CMissionContainerPD::setLoadCallback(void (*callback)(const NLMISC::CEntityId& key, CMissionContainerPD* object))
3136 __pds__LoadCallback = callback;
3138 void CMissionContainerPD::unload(const NLMISC::CEntityId &CharId)
3140 std::map<NLMISC::CEntityId,CMissionContainerPD*>::iterator it = _Map.find(CharId);
3141 if (it != _Map.end())
3143 CMissionContainerPD* __o = (*it).second;
3144 __o->pds__notifyRelease();
3145 __o->pds__destroy();
3146 delete __o;
3149 CMissionContainerPD* CMissionContainerPD::get(const NLMISC::CEntityId &CharId)
3151 std::map<NLMISC::CEntityId, CMissionContainerPD*>::iterator __it = _Map.find(CharId);
3152 return (__it != _Map.end()) ? (*__it).second : NULL;
3154 std::map<NLMISC::CEntityId, CMissionContainerPD*>::iterator CMissionContainerPD::begin()
3156 return _Map.begin();
3158 std::map<NLMISC::CEntityId, CMissionContainerPD*>::iterator CMissionContainerPD::end()
3160 return _Map.end();
3162 void CMissionContainerPD::apply(CPersistentDataRecord &__pdr)
3164 uint16 __Tok_MapKey = __pdr.addString("__Key__");
3165 uint16 __Tok_MapVal = __pdr.addString("__Val__");
3166 uint16 __Tok_ClassName = __pdr.addString("__Class__");
3167 uint16 __TokCharId = __pdr.addString("CharId");
3168 uint16 __TokMissions = __pdr.addString("Missions");
3169 while (!__pdr.isEndOfStruct())
3171 if (false) {}
3172 else if (__pdr.peekNextToken() == __TokCharId)
3174 __pdr.pop(__TokCharId, _CharId);
3176 // apply Missions
3177 else if (__pdr.peekNextToken() == __TokMissions)
3179 __pdr.popStructBegin(__TokMissions);
3180 while (!__pdr.isEndOfStruct())
3182 uint32 key;
3183 __pdr.pop(__Tok_MapKey, key);
3184 __pdr.popStructBegin(__Tok_MapVal);
3185 CMissionPD* obj;
3186 obj = NULL;
3187 if (__pdr.peekNextToken() == __Tok_ClassName)
3189 std::string __className;
3190 __pdr.pop(__Tok_ClassName, __className);
3191 obj = CMissionPD::cast(PDSLib.create(__className));
3192 if (obj != NULL)
3194 __pdr.popStructBegin(__TokMissions);
3195 obj->apply(__pdr);
3196 obj->pds__setParentUnnotified(this);
3197 __pdr.popStructEnd(__TokMissions);
3199 else
3201 __pdr.skipStruct();
3204 if (obj != NULL)
3206 _Missions[key] = obj;
3208 __pdr.popStructEnd(__Tok_MapVal);
3210 __pdr.popStructEnd(__TokMissions);
3212 // end of apply Missions
3213 else
3215 nlwarning("Skipping unrecognised token: %s", __pdr.peekNextTokenName().c_str());
3216 __pdr.skipData();
3219 pds__notifyInit();
3221 void CMissionContainerPD::store(CPersistentDataRecord &__pdr) const
3223 uint16 __Tok_MapKey = __pdr.addString("__Key__");
3224 uint16 __Tok_MapVal = __pdr.addString("__Val__");
3225 uint16 __Tok_ClassName = __pdr.addString("__Class__");
3226 uint16 __TokCharId = __pdr.addString("CharId");
3227 uint16 __TokMissions = __pdr.addString("Missions");
3228 __pdr.push(__TokCharId, _CharId);
3229 // store Missions
3230 __pdr.pushStructBegin(__TokMissions);
3231 for (std::map<uint32, CMissionPD*>::const_iterator it=_Missions.begin(); it!=_Missions.end(); ++it)
3233 uint32 key = (*it).first;
3234 __pdr.push(__Tok_MapKey, key);
3235 __pdr.pushStructBegin(__Tok_MapVal);
3236 if ((*it).second != NULL)
3238 std::string __className = PDSLib.getClassName((*it).second);
3239 __pdr.push(__Tok_ClassName, __className);
3240 __pdr.pushStructBegin(__TokMissions);
3241 (*it).second->store(__pdr);
3242 __pdr.pushStructEnd(__TokMissions);
3244 __pdr.pushStructEnd(__Tok_MapVal);
3246 __pdr.pushStructEnd(__TokMissions);
3247 // end of store Missions
3249 void CMissionContainerPD::pds__init(const NLMISC::CEntityId &CharId)
3251 _CharId = CharId;
3252 _Map[getCharId()] = this;
3254 void CMissionContainerPD::pds__destroy()
3256 for (std::map<uint32, CMissionPD*>::iterator __it=_Missions.begin(); __it!=_Missions.end(); )
3258 std::map<uint32, CMissionPD*>::iterator __itr=__it++;
3259 CMissionPD* __o = ((*__itr).second);
3260 if (__o != NULL)
3262 __o->pds__destroy();
3263 delete __o;
3266 _Missions.clear();
3267 _Map.erase(getCharId());
3269 void CMissionContainerPD::pds__fetch(RY_PDS::CPData &data)
3271 data.serial(_CharId);
3272 RY_PDS::TTableIndex tableIndex;
3273 RY_PDS::TRowIndex rowIndex;
3276 // read table and row, create an object, affect to the ref, and fetch it
3277 data.serial(tableIndex, rowIndex);
3278 if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break;
3279 uint32 __k;
3280 data.serial(__k);
3281 CMissionPD* __o = static_cast<CMissionPD*>(PDSLib.create(tableIndex));
3282 _Missions.insert(std::pair<uint32,CMissionPD*>(__k, __o));
3283 PDSLib.setRowIndex(rowIndex, __o);
3284 __o->pds__fetch(data);
3285 __o->pds__setParentUnnotified(this);
3287 while (true);
3288 _Map[getCharId()] = this;
3290 void CMissionContainerPD::pds__register()
3292 __BaseRow = _IndexAllocator.allocate();
3293 PDSLib.allocateRow(18, __BaseRow, _CharId.asUint64(), _CharId);
3294 pds__registerAttributes();
3296 void CMissionContainerPD::pds__registerAttributes()
3298 if (RY_PDS::PDVerbose) nldebug("CMissionContainerPD: registerAttributes %u:%u", 18, __BaseRow);
3299 PDSLib.set(18, __BaseRow, (RY_PDS::TColumnIndex)(0), _CharId);
3301 void CMissionContainerPD::pds__unregister()
3303 pds__unregisterAttributes();
3304 PDSLib.deallocateRow(18, __BaseRow, _CharId);
3305 _IndexAllocator.deallocate(__BaseRow);
3307 void CMissionContainerPD::pds__unregisterAttributes()
3309 if (RY_PDS::PDVerbose) nldebug("CMissionContainerPD: unregisterAttributes %u:%u", 18, __BaseRow);
3310 for (std::map<uint32, CMissionPD*>::iterator __it=_Missions.begin(); __it!=_Missions.end(); )
3312 std::map<uint32, CMissionPD*>::iterator __itr=__it++;
3313 CMissionPD* __o = (*__itr).second;
3314 __o->pds__unregister();
3315 __o->pds__destroy();
3316 delete __o;
3319 void CMissionContainerPD::pds__notifyInit()
3321 for (std::map<uint32, CMissionPD*>::iterator __it=_Missions.begin(); __it!=_Missions.end(); )
3323 std::map<uint32, CMissionPD*>::iterator __itr=__it++;
3324 (*__itr).second->pds__notifyInit();
3327 void CMissionContainerPD::pds__notifyRelease()
3329 PDSLib.release(18, __BaseRow);
3330 for (std::map<uint32, CMissionPD*>::iterator __it=_Missions.begin(); __it!=_Missions.end(); )
3332 std::map<uint32, CMissionPD*>::iterator __itr=__it++;
3333 (*__itr).second->pds__notifyRelease();
3336 void CMissionContainerPD::pds__unlinkMissions(uint32 __k)
3338 _Missions.erase(__k);
3340 void CMissionContainerPD::pds_static__init()
3342 PDSLib.setIndexAllocator(18, _IndexAllocator);
3343 pds_static__setFactory(pds_static__factory);
3345 std::map<NLMISC::CEntityId,CMissionContainerPD*> CMissionContainerPD::_Map;
3346 void CMissionContainerPD::pds_static__setFactory(RY_PDS::TPDFactory userFactory)
3348 if (!_FactoryInitialised)
3350 PDSLib.registerClass(18, userFactory, pds_static__fetch, pds_static__notifyFailure);
3351 _FactoryInitialised = true;
3354 bool CMissionContainerPD::_FactoryInitialised;
3355 void CMissionContainerPD::pds_static__notifyFailure(uint64 key)
3357 if (__pds__LoadCallback != NULL)
3359 __pds__LoadCallback((NLMISC::CEntityId)key, NULL);
3362 void (*CMissionContainerPD::__pds__LoadCallback)(const NLMISC::CEntityId& key, CMissionContainerPD* object) = NULL;
3363 RY_PDS::CIndexAllocator CMissionContainerPD::_IndexAllocator;
3364 RY_PDS::IPDBaseData* CMissionContainerPD::pds_static__factory()
3366 return new CMissionContainerPD();
3368 void CMissionContainerPD::pds_static__fetch(RY_PDS::IPDBaseData *object, RY_PDS::CPData &data)
3370 CMissionContainerPD *__o = static_cast<CMissionContainerPD*>(object);
3371 __o->pds__fetch(data);
3372 if (__pds__LoadCallback != NULL)
3374 __pds__LoadCallback(__o->getCharId(), __o);
3376 __o->pds__notifyInit();
3378 // End of static implementation of CMissionContainerPD
3381 } // End of EGSPD