#include "./AI.h" void AI::WriteSublimatObjects(SublimatObjects *in) { SO=in; } SublimatObjects *AI::GetSublimatObjects() { return SO; } void AI::AddObjectToSO(AI *InObject) { int s; UObject TempUObject; s=SO->GetSectorN(InObject->GetCord()); InObject->WriteSublimatObjects(SO); InObject->WritenSector(s); TempUObject.in=InObject; SO->GetSO()->push_front(TempUObject); SO->GetSeO()[s].push_front(TempUObject); } void AI::Kill() { ObjectList::iterator it1; for (it1 = SO->GetSeO ()[nSector]. begin ();it1 != SO->GetSeO ()[nSector].end ();it1++) { if (it1->in == this) { SO->GetSeO ()[nSector].erase (it1); break; } } for (it1 = SO->GetSO ()->begin (); it1 != SO->GetSO ()->end (); it1++) { if (it1->in == this) { SO->GetSO ()->erase (it1); break; } } delete this; } void WorldInit(WorldObjects *WIN) { int i,s; ObjectList::iterator it1; for(i=0;iGetnWorld();i++) { for(it1=WIN->GetSub(i)->GetSO()->begin(); it1!=WIN->GetSub(i)->GetSO()->end(); it1++) { AI *AItemp=(AI*)it1->in; WIN->GetSub(i)->GetSeO()[(s=WIN->GetSub(i)->GetSectorN(AItemp->GetCord()))].push_front(*it1); AItemp->WriteSublimatObjects(WIN->GetSub(i)); AItemp->WritenSector(s); cout<<"Sector n:"<