public void RelocateEntities() { foreach ( IEntity entity in GetHouseEntities() ) { Point3D relLoc = new Point3D( entity.X - this.X, entity.Y - this.Y, entity.Z - this.Z ); RelocatedEntity relocEntity = new RelocatedEntity( entity, relLoc ); RelocatedEntities.Add( relocEntity ); if ( entity is Item ) ((Item)entity).Internalize(); else ((Mobile)entity).Internalize(); } }
public void RelocateEntities() { foreach (IEntity entity in GetHouseEntities()) { var relLoc = new Point3D(entity.X - X, entity.Y - Y, entity.Z - Z); var relocEntity = new RelocatedEntity(entity, relLoc); RelocatedEntities.Add(relocEntity); if (entity is Item) { ((Item) entity).Internalize(); } else { ((Mobile) entity).Internalize(); } } }