#include <C4ObjectList.h>
Classes | |
class | iterator |
class | ReverseView |
Public Types | |
enum | SortType { stNone = 0 , stMain , stContents , stReverse } |
typedef int | SortProc(C4Object *, C4Object *) |
Public Member Functions | |
C4ObjectList () | |
C4ObjectList (const C4ObjectList &list) | |
virtual | ~C4ObjectList () |
iterator | begin () const |
const iterator | end () const |
const ReverseView | reverse () const |
virtual void | Default () |
virtual void | Clear () |
void | Sort () |
void | Copy (const C4ObjectList &list) |
void | DrawIfCategory (C4TargetFacet &cgo, int player, uint32_t dwCategory, bool invert) |
void | Draw (C4TargetFacet &cgo, int player, int MinPlane, int MaxPlane) |
void | DrawSelectMark (C4TargetFacet &cgo) const |
void | CloseMenus () |
void | UpdateGraphics (bool graphics_changed) |
void | UpdateFaces (bool update_shape) |
void | ClearInfo (C4ObjectInfo *info) |
virtual bool | Add (C4Object *new_obj, SortType sort_type, C4ObjectList *sorted_list=nullptr) |
bool | AddSortCustom (C4Object *new_obj, SortProc &pSortProc) |
virtual bool | Remove (C4Object *obj) |
virtual bool | AssignInfo () |
virtual bool | ValidateOwners () |
StdStrBuf | GetNameList (C4DefList &defs) const |
bool | IsClear () const |
bool | DenumeratePointers () |
bool | Write (char *szTarget) |
void | CompileFunc (StdCompiler *pComp, C4ValueNumbers *=nullptr) |
void | CompileFunc (StdCompiler *pComp, bool skip_player_objects, C4ValueNumbers *) |
void | Denumerate (C4ValueNumbers *) |
bool | IsContained (const C4Object *obj) const |
int | ClearPointers (C4Object *obj) |
int | ObjectCount (C4ID id=C4ID::None) const |
int | MassCount () |
int | ListIDCount (int32_t dwCategory) const |
C4Object * | GetObject (int index=0) const |
C4Object * | GetFirstObject () const |
C4Object * | GetLastObject () const |
C4Object * | Find (C4Def *def, int owner=ANY_OWNER, DWORD dwOCF=OCF_All) |
C4Object * | FindOther (C4ID id, int owner=ANY_OWNER) |
const C4ObjectLink * | GetLink (const C4Object *obj) const |
C4ObjectLink * | GetLink (const C4Object *obj) |
C4ID | GetListID (int32_t dwCategory, int index) const |
bool | ShiftContents (C4Object *new_first) |
void | DeleteObjects () |
void | UpdateScriptPointers () |
bool | CheckSort (C4ObjectList *list) |
void | CheckCategorySort () |
Public Attributes | |
C4ObjectLink * | First |
C4ObjectLink * | Last |
int | Mass |
std::list< int32_t > * | pEnumerated |
Protected Member Functions | |
virtual void | InsertLinkBefore (C4ObjectLink *link, C4ObjectLink *before_link) |
virtual void | InsertLink (C4ObjectLink *link, C4ObjectLink *after_link) |
virtual void | RemoveLink (C4ObjectLink *link) |
iterator * | AddIter (iterator *iter) const |
void | RemoveIter (iterator *iter) const |
Protected Attributes | |
iterator * | FirstIter {nullptr} |
Friends | |
class | iterator |
Definition at line 44 of file C4ObjectList.h.
Definition at line 118 of file C4ObjectList.h.
C4ObjectList::C4ObjectList | ( | ) |
Definition at line 32 of file C4ObjectList.cpp.
References Default().
C4ObjectList::C4ObjectList | ( | const C4ObjectList & | list | ) |
Definition at line 37 of file C4ObjectList.cpp.
References Copy(), and Default().
|
virtual |
Definition at line 43 of file C4ObjectList.cpp.
References Clear().
|
virtual |
Definition at line 164 of file C4ObjectList.cpp.
References C4D_StaticBack, C4Object::Category, CheckCategorySort(), CheckSort(), C4Object::Def, First, GetLink(), C4Object::GetPlane(), C4Object::id, InsertLink(), Last, C4Object::Mass, Mass, C4ObjectLink::Next, C4ObjectLink::Obj, C4ObjectLink::Prev, C4PropList::Status, stMain, stReverse, and C4Object::Unsorted.
Referenced by C4GameObjects::Add(), C4LSectors::Add(), CompileFunc(), Copy(), DenumeratePointers(), C4Object::Enter(), C4Player::MakeCrewMember(), C4Player::PlaceReadyCrew(), C4GameObjects::PostLoad(), C4Object::StatusDeactivate(), C4LSectors::Update(), and C4MouseControl::UpdateSingleSelection().
|
protected |
Definition at line 1238 of file C4ObjectList.cpp.
References FirstIter.
Referenced by C4ObjectList::iterator::iterator().
|
virtual |
Reimplemented in C4GameObjects.
Definition at line 732 of file C4ObjectList.cpp.
References C4Object::AssignInfo(), Last, C4ObjectLink::Obj, C4ObjectLink::Prev, and C4PropList::Status.
Referenced by C4GameObjects::AssignInfo().
C4ObjectList::iterator C4ObjectList::begin | ( | ) | const |
Definition at line 1230 of file C4ObjectList.cpp.
References First, and iterator.
Referenced by C4GameObjects::PostLoad(), and C4Object::ShiftContents().
void C4ObjectList::CheckCategorySort | ( | ) |
Definition at line 1126 of file C4ObjectList.cpp.
References First, C4Object::GetPlane(), C4ObjectLink::Next, C4ObjectLink::Obj, C4PropList::Status, and C4Object::Unsorted.
Referenced by Add().
bool C4ObjectList::CheckSort | ( | C4ObjectList * | list | ) |
Definition at line 1091 of file C4ObjectList.cpp.
References First, Log(), LogSilent(), mkNamingAdapt(), C4ObjectLink::Next, C4ObjectLink::Obj, C4PropList::Status, and C4Object::Unsorted.
Referenced by Add(), and C4LSectors::CheckSort().
|
virtual |
Reimplemented in C4GameObjects.
Definition at line 48 of file C4ObjectList.cpp.
References First, FirstIter, Last, C4ObjectLink::Next, and pEnumerated.
Referenced by C4MouseControl::Clear(), C4GameObjects::Clear(), C4LSector::ClearObjects(), CompileFunc(), Copy(), C4GameObjects::DeleteObjects(), C4MouseControl::LeftUpDragNone(), C4GameObjects::PostLoad(), C4MouseControl::UpdateSingleSelection(), and ~C4ObjectList().
void C4ObjectList::ClearInfo | ( | C4ObjectInfo * | info | ) |
Definition at line 748 of file C4ObjectList.cpp.
References C4Object::ClearInfo(), First, C4ObjectLink::Next, C4ObjectLink::Obj, and C4PropList::Status.
Referenced by C4ObjectInfoList::DetachFromObjects().
int C4ObjectList::ClearPointers | ( | C4Object * | obj | ) |
Definition at line 481 of file C4ObjectList.cpp.
References C4Object::ClearPointers(), First, C4ObjectLink::Next, C4ObjectLink::Obj, and Remove().
Referenced by C4Game::ClearPointers(), and C4MouseControl::ClearPointers().
void C4ObjectList::CloseMenus | ( | ) |
Definition at line 933 of file C4ObjectList.cpp.
References C4Object::CloseMenu(), First, C4ObjectLink::Next, and C4ObjectLink::Obj.
void C4ObjectList::CompileFunc | ( | StdCompiler * | pComp, |
bool | skip_player_objects, | ||
C4ValueNumbers * | numbers | ||
) |
Definition at line 622 of file C4ObjectList.cpp.
References Add(), Clear(), StdStrBuf::getData(), StdStrBuf::getLength(), StdCompiler::hasNaming(), StdCompiler::isSerializer(), C4Object::IsUserPlayerObject(), Last, LogF(), mkNamingAdapt(), mkNamingCountAdapt(), mkParAdapt(), mkPtrAdaptNoNull(), StdCompiler::Exception::Msg, C4ObjectLink::Obj, ObjectCount(), StdCompiler::Exception::Pos, C4ObjectLink::Prev, C4PropList::Status, stReverse, and StdCompiler::Value().
void C4ObjectList::CompileFunc | ( | StdCompiler * | pComp, |
C4ValueNumbers * | numbers = nullptr |
||
) |
Definition at line 672 of file C4ObjectList.cpp.
References First, StdCompiler::isDeserializer(), mkSTLContainerAdapt(), C4ObjectLink::Next, C4PropListNumbered::Number, C4ObjectLink::Obj, pEnumerated, StdCompiler::SEP_SEP2, C4PropList::Status, and StdCompiler::Value().
void C4ObjectList::Copy | ( | const C4ObjectList & | list | ) |
Definition at line 943 of file C4ObjectList.cpp.
References Add(), Clear(), Default(), First, C4ObjectLink::Next, C4ObjectLink::Obj, and stNone.
Referenced by C4ObjectList(), C4Object::GrabContents(), and C4GameObjects::PostLoad().
|
virtual |
Reimplemented in C4GameObjects.
Definition at line 953 of file C4ObjectList.cpp.
References First, Last, Mass, and pEnumerated.
Referenced by C4ObjectList(), C4Player::C4Player(), Copy(), C4MouseControl::Default(), C4Object::Default(), and C4GameObjects::Default().
void C4ObjectList::DeleteObjects | ( | ) |
Definition at line 986 of file C4ObjectList.cpp.
References C4OS_DELETED, C4Game::ClearPointers(), First, Game, Mass, C4ObjectLink::Obj, Remove(), and C4PropList::Status.
Referenced by C4GameObjects::Clear(), and C4GameObjects::DeleteObjects().
void C4ObjectList::Denumerate | ( | C4ValueNumbers * | numbers | ) |
Definition at line 610 of file C4ObjectList.cpp.
References C4Object::Denumerate(), First, C4ObjectLink::Next, C4ObjectLink::Obj, and C4PropList::Status.
Referenced by C4GameObjects::Denumerate().
bool C4ObjectList::DenumeratePointers | ( | ) |
Definition at line 577 of file C4ObjectList.cpp.
References Add(), C4GameObjects::ObjectPointer(), Objects, pEnumerated, and stNone.
Referenced by C4Object::Denumerate(), and C4Player::DenumeratePointers().
void C4ObjectList::Draw | ( | C4TargetFacet & | cgo, |
int | player, | ||
int | MinPlane, | ||
int | MaxPlane | ||
) |
Definition at line 499 of file C4ObjectList.cpp.
References C4D_Foreground, C4Object::Category, C4Object::Draw(), C4Object::DrawTopFace(), C4Object::GetPlane(), Last, C4ObjectLink::Obj, C4ScriptGuiWindowPropertyName::player, and C4ObjectLink::Prev.
Referenced by C4Viewport::Draw().
void C4ObjectList::DrawIfCategory | ( | C4TargetFacet & | cgo, |
int | player, | ||
uint32_t | dwCategory, | ||
bool | invert | ||
) |
Definition at line 538 of file C4ObjectList.cpp.
References C4Object::Category, C4Object::Draw(), C4Object::DrawTopFace(), Last, C4ObjectLink::Obj, C4ScriptGuiWindowPropertyName::player, and C4ObjectLink::Prev.
Referenced by C4Viewport::Draw().
void C4ObjectList::DrawSelectMark | ( | C4TargetFacet & | cgo | ) | const |
Definition at line 924 of file C4ObjectList.cpp.
References C4Object::DrawSelectMark(), Last, C4ObjectLink::Obj, and C4ObjectLink::Prev.
Referenced by C4MouseControl::Draw().
const C4ObjectList::iterator C4ObjectList::end | ( | ) | const |
Definition at line 1234 of file C4ObjectList.cpp.
References iterator.
Referenced by C4ObjectListIterator::GetNext().
Definition at line 383 of file C4ObjectList.cpp.
References ANY_OWNER, C4Object::Def, First, C4ObjectLink::Next, C4ObjectLink::Obj, C4Object::OCF, C4Object::Owner, and C4PropList::Status.
Referenced by C4Command::Acquire(), C4ObjectMenu::DoRefillInternal(), C4RoundResults::EvaluateGoals(), C4Command::Get(), C4MainMenu::MenuCommand(), and C4Command::Put().
Definition at line 400 of file C4ObjectList.cpp.
References ANY_OWNER, C4Object::Def, First, C4Def::id, C4ObjectLink::Next, C4ObjectLink::Obj, C4Object::Owner, and C4PropList::Status.
|
inline |
Definition at line 141 of file C4ObjectList.h.
References First, and C4ObjectLink::Obj.
Referenced by C4Player::CheckElimination().
|
inline |
Definition at line 142 of file C4ObjectList.h.
References Last, and C4ObjectLink::Obj.
Referenced by C4Object::PutAwayUnusedObject().
|
inline |
Definition at line 147 of file C4ObjectList.h.
References GetLink().
const C4ObjectLink * C4ObjectList::GetLink | ( | const C4Object * | obj | ) | const |
Definition at line 435 of file C4ObjectList.cpp.
References First, C4ObjectLink::Next, and C4ObjectLink::Obj.
Referenced by Add(), C4Object::AssignInfo(), C4Command::Drop(), GetLink(), C4Player::MakeCrewMember(), C4GameObjects::PostLoad(), C4Command::Put(), Remove(), ShiftContents(), and C4Command::Throw().
C4ID C4ObjectList::GetListID | ( | int32_t | dwCategory, |
int | index | ||
) | const |
Definition at line 73 of file C4ObjectList.cpp.
References C4D_All, C4Id2Def(), C4Def::Category, C4Object::Def, First, C4Def::id, Inside(), MaxTempListID, C4ObjectLink::Next, C4ID::None, C4ObjectLink::Obj, C4PropList::Status, and TempListID.
Referenced by C4MainMenu::ActivateRules(), C4RoundResults::EvaluateGoals(), and GetNameList().
Definition at line 699 of file C4ObjectList.cpp.
References StdStrBuf::Append(), StdStrBuf::AppendFormat(), C4D_All, GetListID(), C4PropListStatic::GetName(), C4DefList::ID2Def(), and ObjectCount().
Referenced by C4Object::GetDataString().
C4Object * C4ObjectList::GetObject | ( | int | index = 0 | ) | const |
Definition at line 416 of file C4ObjectList.cpp.
References First, C4ObjectLink::Next, C4ObjectLink::Obj, and C4PropList::Status.
Referenced by C4Object::AssignDeath(), C4Object::DirectComContents(), C4Object::DoCon(), C4MouseControl::LeftUpDragNone(), ObjectActionThrow(), ObjectComDrop(), ObjectComPut(), ObjectComPutTake(), ObjectComThrow(), C4Command::Put(), C4Player::RemoveCrewObjects(), C4MouseControl::RightUpDragNone(), C4Object::ShiftContents(), and C4MouseControl::UpdateSingleSelection().
|
protectedvirtual |
Reimplemented in C4NotifyingObjectList.
Definition at line 789 of file C4ObjectList.cpp.
References First, FirstIter, Last, C4ObjectLink::Next, C4ObjectLink::Obj, and C4ObjectLink::Prev.
Referenced by Add(), C4NotifyingObjectList::InsertLink(), and Sort().
|
protectedvirtual |
Reimplemented in C4NotifyingObjectList.
Definition at line 835 of file C4ObjectList.cpp.
References First, FirstIter, Last, C4ObjectLink::Next, C4ObjectLink::Obj, and C4ObjectLink::Prev.
Referenced by C4NotifyingObjectList::InsertLinkBefore().
bool C4ObjectList::IsClear | ( | ) | const |
Definition at line 572 of file C4ObjectList.cpp.
References ObjectCount().
bool C4ObjectList::IsContained | ( | const C4Object * | obj | ) | const |
Definition at line 559 of file C4ObjectList.cpp.
References First, C4ObjectLink::Next, and C4ObjectLink::Obj.
Referenced by C4LSectors::AssertObjectNotInList(), C4Object::IsPlayerObject(), C4Player::NotifyOwnedObjects(), and C4Player::SetObjectCrewStatus().
int C4ObjectList::ListIDCount | ( | int32_t | dwCategory | ) | const |
int C4ObjectList::MassCount | ( | ) |
Definition at line 466 of file C4ObjectList.cpp.
References First, C4Object::Mass, Mass, C4ObjectLink::Next, C4ObjectLink::Obj, and C4PropList::Status.
Referenced by C4Object::UpdateMass().
int C4ObjectList::ObjectCount | ( | C4ID | id = C4ID::None | ) | const |
Definition at line 452 of file C4ObjectList.cpp.
References C4Object::Def, First, C4Def::id, C4ObjectLink::Next, C4ID::None, C4ObjectLink::Obj, and C4PropList::Status.
Referenced by C4Object::AssignDeath(), CompileFunc(), C4Game::CompileRuntimeData(), C4FindObject::Count(), C4EditCursor::DoContextMenu(), C4ObjectMenu::DoRefillInternal(), C4ObjectMenu::Execute(), C4Network2Stats::ExecuteFrame(), C4Object::GetDataString(), GetNameList(), C4Game::InitGameFinal(), IsClear(), C4GameObjects::PostLoad(), C4ControlSyncCheck::Set(), and C4MouseControl::UpdateSingleSelection().
|
virtual |
Reimplemented in C4GameObjects.
Definition at line 328 of file C4ObjectList.cpp.
References First, FirstIter, GetLink(), C4Object::Mass, Mass, C4ObjectLink::Next, C4ObjectLink::Obj, C4ObjectLink::Prev, and RemoveLink().
Referenced by C4Object::AssignInfo(), C4Object::AssignRemoval(), ClearPointers(), C4Object::ClearPointers(), C4Player::ClearPointers(), DeleteObjects(), C4Object::Exit(), C4GameObjects::Remove(), C4LSectors::Remove(), C4Player::SetObjectCrewStatus(), C4Object::StatusActivate(), and C4LSectors::Update().
|
protected |
|
protectedvirtual |
Reimplemented in C4NotifyingObjectList.
Definition at line 782 of file C4ObjectList.cpp.
References First, Last, C4ObjectLink::Next, and C4ObjectLink::Prev.
Referenced by Remove(), C4NotifyingObjectList::RemoveLink(), and Sort().
|
inline |
Definition at line 104 of file C4ObjectList.h.
Referenced by C4GameObjects::AssignLightRange(), C4PropertyCollection::CollectPropLists(), C4Game::ExecObjects(), C4ObjectList::iterator::operator++(), C4ObjectList::iterator::operator=(), C4ObjectList::iterator::operator==(), C4GameObjects::PostLoad(), C4ObjectList::iterator::reset(), and C4Object::ShiftContents().
bool C4ObjectList::ShiftContents | ( | C4Object * | new_first | ) |
Definition at line 960 of file C4ObjectList.cpp.
References First, GetLink(), Last, C4ObjectLink::Next, and C4ObjectLink::Prev.
Referenced by C4Object::DirectComContents().
void C4ObjectList::Sort | ( | ) |
Definition at line 760 of file C4ObjectList.cpp.
References First, C4Object::id, InsertLink(), C4ObjectLink::Next, C4ObjectLink::Obj, and RemoveLink().
void C4ObjectList::UpdateFaces | ( | bool | update_shape | ) |
Definition at line 912 of file C4ObjectList.cpp.
References First, C4ObjectLink::Next, C4ObjectLink::Obj, C4PropList::Status, and C4Object::UpdateFace().
Referenced by C4GameObjects::PostLoad().
void C4ObjectList::UpdateGraphics | ( | bool | graphics_changed | ) |
Definition at line 900 of file C4ObjectList.cpp.
References First, C4ObjectLink::Next, C4ObjectLink::Obj, C4PropList::Status, and C4Object::UpdateGraphics().
Referenced by C4GameObjects::PostLoad().
void C4ObjectList::UpdateScriptPointers | ( | ) |
Definition at line 1073 of file C4ObjectList.cpp.
References First, C4ObjectLink::Next, C4ObjectLink::Obj, and C4Object::UpdateScriptPointers().
Referenced by C4GameObjects::UpdateScriptPointers().
|
virtual |
Reimplemented in C4GameObjects.
Definition at line 719 of file C4ObjectList.cpp.
References First, C4ObjectLink::Next, C4ObjectLink::Obj, C4PropList::Status, and C4Object::ValidateOwner().
Referenced by C4GameObjects::ValidateOwners().
bool C4ObjectList::Write | ( | char * | szTarget | ) |
Definition at line 594 of file C4ObjectList.cpp.
References First, C4ObjectLink::Next, C4PropListNumbered::Number, C4ObjectLink::Obj, SAppend(), sprintf, and C4PropList::Status.
|
friend |
Definition at line 169 of file C4ObjectList.h.
Referenced by begin(), C4ObjectList::ReverseView::begin(), end(), and C4ObjectList::ReverseView::end().
C4ObjectLink* C4ObjectList::First |
Definition at line 51 of file C4ObjectList.h.
Referenced by Add(), begin(), CheckCategorySort(), CheckSort(), Clear(), ClearInfo(), ClearPointers(), CloseMenus(), CompileFunc(), Copy(), Default(), DeleteObjects(), Denumerate(), Find(), FindOther(), C4GameObjects::FixObjectOrder(), GetFirstObject(), GetLink(), GetListID(), GetObject(), InsertLink(), InsertLinkBefore(), IsContained(), MassCount(), ObjectCount(), Remove(), RemoveLink(), ShiftContents(), Sort(), UpdateFaces(), UpdateGraphics(), UpdateScriptPointers(), ValidateOwners(), and Write().
|
mutableprotected |
Definition at line 165 of file C4ObjectList.h.
Referenced by AddIter(), Clear(), InsertLink(), InsertLinkBefore(), Remove(), and RemoveIter().
C4ObjectLink * C4ObjectList::Last |
Definition at line 51 of file C4ObjectList.h.
Referenced by Add(), AssignInfo(), C4ObjectList::ReverseView::begin(), Clear(), CompileFunc(), Default(), Draw(), DrawIfCategory(), DrawSelectMark(), C4GameObjects::FixObjectOrder(), GetLastObject(), InsertLink(), InsertLinkBefore(), RemoveLink(), and ShiftContents().
int C4ObjectList::Mass |
Definition at line 52 of file C4ObjectList.h.
Referenced by Add(), Default(), DeleteObjects(), MassCount(), Remove(), and C4Object::UpdateMass().
std::list<int32_t>* C4ObjectList::pEnumerated |
Definition at line 53 of file C4ObjectList.h.
Referenced by Clear(), CompileFunc(), Default(), and DenumeratePointers().