|
|
@@ -122,9 +122,9 @@ public class Level
|
|
|
|
|
|
foreach (Guid id in ids)
|
|
|
{
|
|
|
- if (_db.object_type(id) == "unit")
|
|
|
+ if (_db.object_type(id) == OBJECT_TYPE_UNIT)
|
|
|
units += id;
|
|
|
- else if (_db.object_type(id) == "sound_source")
|
|
|
+ else if (_db.object_type(id) == OBJECT_TYPE_SOUND_SOURCE)
|
|
|
sounds += id;
|
|
|
}
|
|
|
|
|
|
@@ -202,11 +202,11 @@ public class Level
|
|
|
{
|
|
|
_db.duplicate(ids[i], new_ids[i]);
|
|
|
|
|
|
- if (_db.object_type(ids[i]) == "unit")
|
|
|
+ if (_db.object_type(ids[i]) == OBJECT_TYPE_UNIT)
|
|
|
{
|
|
|
_db.add_to_set(_id, "units", new_ids[i]);
|
|
|
}
|
|
|
- else if (_db.object_type(ids[i]) == "sound_source")
|
|
|
+ else if (_db.object_type(ids[i]) == OBJECT_TYPE_SOUND_SOURCE)
|
|
|
{
|
|
|
_db.add_to_set(_id, "sounds", new_ids[i]);
|
|
|
}
|
|
|
@@ -270,7 +270,7 @@ public class Level
|
|
|
Quaternion rot = rotations[i];
|
|
|
Vector3 scl = scales[i];
|
|
|
|
|
|
- if (_db.object_type(id) == "unit")
|
|
|
+ if (_db.object_type(id) == OBJECT_TYPE_UNIT)
|
|
|
{
|
|
|
Unit unit = new Unit(_db, id);
|
|
|
Guid component_id;
|
|
|
@@ -287,7 +287,7 @@ public class Level
|
|
|
_db.set_property_vector3 (id, "scale", scl);
|
|
|
}
|
|
|
}
|
|
|
- else if (_db.object_type(id) == "sound_source")
|
|
|
+ else if (_db.object_type(id) == OBJECT_TYPE_SOUND_SOURCE)
|
|
|
{
|
|
|
_db.set_property_vector3 (id, "position", pos);
|
|
|
_db.set_property_quaternion(id, "rotation", rot);
|
|
|
@@ -490,11 +490,11 @@ public class Level
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
for (int i = 0; i < ids.length; ++i)
|
|
|
{
|
|
|
- if (_db.object_type(ids[i]) == "unit")
|
|
|
+ if (_db.object_type(ids[i]) == OBJECT_TYPE_UNIT)
|
|
|
{
|
|
|
generate_spawn_unit_commands(new Guid[] { ids[i] }, sb);
|
|
|
}
|
|
|
- else if (_db.object_type(ids[i]) == "sound_source")
|
|
|
+ else if (_db.object_type(ids[i]) == OBJECT_TYPE_SOUND_SOURCE)
|
|
|
{
|
|
|
generate_spawn_sound_commands(new Guid[] { ids[i] }, sb);
|
|
|
}
|
|
|
@@ -691,7 +691,7 @@ public class Level
|
|
|
|
|
|
for (int i = 0; i < ids.length; ++i)
|
|
|
{
|
|
|
- if (_db.object_type(ids[i]) == "unit")
|
|
|
+ if (_db.object_type(ids[i]) == OBJECT_TYPE_UNIT)
|
|
|
{
|
|
|
Guid unit_id = ids[i];
|
|
|
|
|
|
@@ -710,7 +710,7 @@ public class Level
|
|
|
scales[i] = _db.get_property_vector3 (unit_id, "scale");
|
|
|
}
|
|
|
}
|
|
|
- else if (_db.object_type(ids[i]) == "sound_source")
|
|
|
+ else if (_db.object_type(ids[i]) == OBJECT_TYPE_SOUND_SOURCE)
|
|
|
{
|
|
|
Guid sound_id = ids[i];
|
|
|
positions[i] = _db.get_property_vector3 (sound_id, "position");
|
|
|
@@ -854,11 +854,11 @@ public class Level
|
|
|
{
|
|
|
HashSet<Guid?> units = _db.get_property_set(_id, "units", new HashSet<Guid?>());
|
|
|
foreach (var id in units)
|
|
|
- _db.set_object_type(id, "unit");
|
|
|
+ _db.set_object_type(id, OBJECT_TYPE_UNIT);
|
|
|
|
|
|
HashSet<Guid?> sounds = _db.get_property_set(_id, "sounds", new HashSet<Guid?>());
|
|
|
foreach (var id in sounds)
|
|
|
- _db.set_object_type(id, "sound_source");
|
|
|
+ _db.set_object_type(id, OBJECT_TYPE_SOUND_SOURCE);
|
|
|
}
|
|
|
}
|
|
|
|