mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-18 08:02:56 -04:00
Refactored ClientFactory to be used statically
This commit is contained in:
@@ -50,9 +50,7 @@ import resources.objects.waypoint.WaypointObject;
|
||||
import resources.objects.weapon.WeaponObject;
|
||||
|
||||
public final class ObjectCreator {
|
||||
|
||||
private static final ClientFactory clientFac = new ClientFactory();
|
||||
|
||||
|
||||
public static final SWGObject createObjectFromTemplate(long objectId, String template) {
|
||||
if (!template.startsWith("object/"))
|
||||
return null;
|
||||
@@ -93,7 +91,7 @@ public final class ObjectCreator {
|
||||
}
|
||||
|
||||
private static void addObjectAttributes(SWGObject obj, String template) {
|
||||
ObjectData attributes = (ObjectData) clientFac.getInfoFromFile(ClientFactory.formatToSharedFile(template));
|
||||
ObjectData attributes = (ObjectData) ClientFactory.getInfoFromFile(ClientFactory.formatToSharedFile(template));
|
||||
|
||||
String stf = (String) attributes.getAttribute(ObjectData.OBJ_STF);
|
||||
String detailStf = (String) attributes.getAttribute(ObjectData.DETAIL_STF);
|
||||
@@ -122,7 +120,7 @@ public final class ObjectCreator {
|
||||
private static void createObjectSlots(SWGObject object) {
|
||||
if (object.getTemplateAttribute(ObjectData.SLOT_DESCRIPTOR) != null) {
|
||||
// These are the slots that the object *HAS*
|
||||
SlotDescriptorData descriptor = (SlotDescriptorData) clientFac.getInfoFromFile((String) object.getTemplateAttribute(ObjectData.SLOT_DESCRIPTOR));
|
||||
SlotDescriptorData descriptor = (SlotDescriptorData) ClientFactory.getInfoFromFile((String) object.getTemplateAttribute(ObjectData.SLOT_DESCRIPTOR));
|
||||
|
||||
for (String slotName : descriptor.getSlots()) {
|
||||
object.getSlots().put(slotName, null);
|
||||
@@ -131,7 +129,7 @@ public final class ObjectCreator {
|
||||
|
||||
if (object.getTemplateAttribute(ObjectData.ARRANGEMENT_FILE) != null) {
|
||||
// This is what slots the created object is able to go into/use
|
||||
SlotArrangementData arrangementData = (SlotArrangementData) clientFac.getInfoFromFile((String) object.getTemplateAttribute(ObjectData.ARRANGEMENT_FILE));
|
||||
SlotArrangementData arrangementData = (SlotArrangementData) ClientFactory.getInfoFromFile((String) object.getTemplateAttribute(ObjectData.ARRANGEMENT_FILE));
|
||||
object.setArrangement(arrangementData.getArrangement());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user