History

more renaming to entity from model where we're really talking about an entity

ZappoMan committed 12 years ago

Commit fe30d381 parent 86556647 files · +239 −239Browse files

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 7 files). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+8−8
@@ -29,7 +29,7 @@ EntityItemID EntityScriptingInterface::addEntity(const EntityItemProperties& pro · 28 unmodified lines
2929 // The application will keep track of creatorTokenID
3030 uint32_t creatorTokenID = EntityItem::getNextCreatorTokenID();
3131
32− EntityItemID id(NEW_MODEL, creatorTokenID, false );
32+ EntityItemID id(NEW_ENTITY, creatorTokenID, false );
3333
3434 // queue the packet
3535 queueEntityMessage(PacketTypeEntityAddOrEdit, id, properties);
@@ -49,7 +49,7 @@ EntityItemID EntityScriptingInterface::identifyEntity(EntityItemID entityID) { · 13 unmodified lines
4949
5050 if (!entityID.isKnownID) {
5151 actualID = EntityItem::getIDfromCreatorTokenID(entityID.creatorTokenID);
52− if (actualID == UNKNOWN_MODEL_ID) {
52+ if (actualID == UNKNOWN_ENTITY_ID) {
5353 return entityID; // bailing early
5454 }
5555
@@ -92,7 +92,7 @@ EntityItemID EntityScriptingInterface::editEntity(EntityItemID entityID, const E · 36 unmodified lines
9292 }
9393
9494 // if at this point, we know the id, send the update to the model server
95− if (actualID != UNKNOWN_MODEL_ID) {
95+ if (actualID != UNKNOWN_ENTITY_ID) {
9696 entityID.id = actualID;
9797 entityID.isKnownID = true;
9898 queueEntityMessage(PacketTypeEntityAddOrEdit, entityID, properties);
@@ -109,9 +109,9 @@ EntityItemID EntityScriptingInterface::editEntity(EntityItemID entityID, const E · 10 unmodified lines
109109 }
110110
111111
112−// TODO: This deleteEntity() method uses the PacketType_MODEL_ADD_OR_EDIT message to send
112+// TODO: This deleteEntity() method uses the PacketTypeEntityAddOrEdit message to send
113113 // a changed model with a shouldDie() property set to true. This works and is currently the only
114−// way to tell the model server to delete a model. But we should change this to use the PacketType_MODEL_ERASE
114+// way to tell the model server to delete a model. But we should change this to use the PacketTypeEntityErase
115115 // message which takes a list of model id's to delete.
116116 void EntityScriptingInterface::deleteEntity(EntityItemID entityID) {
117117
@@ -127,7 +127,7 @@ void EntityScriptingInterface::deleteEntity(EntityItemID entityID) { · 9 unmodified lines
127127 }
128128
129129 // if at this point, we know the id, send the update to the model server
130− if (actualID != UNKNOWN_MODEL_ID) {
130+ if (actualID != UNKNOWN_ENTITY_ID) {
131131 entityID.id = actualID;
132132 entityID.isKnownID = true;
133133 queueEntityMessage(PacketTypeEntityAddOrEdit, entityID, properties);
@@ -142,7 +142,7 @@ void EntityScriptingInterface::deleteEntity(EntityItemID entityID) { · 8 unmodified lines
142142 }
143143
144144 EntityItemID EntityScriptingInterface::findClosestEntity(const glm::vec3& center, float radius) const {
145− EntityItemID result(UNKNOWN_MODEL_ID, UNKNOWN_MODEL_TOKEN, false);
145+ EntityItemID result(UNKNOWN_ENTITY_ID, UNKNOWN_ENTITY_TOKEN, false);
146146 if (_entityTree) {
147147 _entityTree->lockForRead();
148148 const EntityItem* closestEntity = _entityTree->findClosestEntity(center/(float)TREE_SCALE,
@@ -166,7 +166,7 @@ QVector<EntityItemID> EntityScriptingInterface::findEntities(const glm::vec3& ce · 17 unmodified lines
166166 _entityTree->unlock();
167167
168168 foreach (const EntityItem* model, models) {
169− EntityItemID thisEntityItemID(model->getID(), UNKNOWN_MODEL_TOKEN, true);
169+ EntityItemID thisEntityItemID(model->getID(), UNKNOWN_ENTITY_TOKEN, true);
170170 result << thisEntityItemID;
171171 }
172172 }