/**
*/
package net.cis.common.model.shipdevice.impl;
import net.cis.common.model.base.BasePackage;
import net.cis.common.model.base.impl.BasePackageImpl;
import net.cis.common.model.descriptor.DescriptorPackage;
import net.cis.common.model.descriptor.impl.DescriptorPackageImpl;
import net.cis.common.model.modeler.ModelerPackage;
import net.cis.common.model.modeler.impl.ModelerPackageImpl;
import net.cis.common.model.sector.SectorPackage;
import net.cis.common.model.sector.impl.SectorPackageImpl;
import net.cis.common.model.shipdevice.AbstractEnergyWeapon;
import net.cis.common.model.shipdevice.AbstractShipDevice;
import net.cis.common.model.shipdevice.AbstractWeapon;
import net.cis.common.model.shipdevice.Beam;
import net.cis.common.model.shipdevice.EnergyTorpedo;
import net.cis.common.model.shipdevice.EngineDevice;
import net.cis.common.model.shipdevice.MassDriver;
import net.cis.common.model.shipdevice.Missile;
import net.cis.common.model.shipdevice.Pulse;
import net.cis.common.model.shipdevice.ShieldDevice;
import net.cis.common.model.shipdevice.ShipdeviceFactory;
import net.cis.common.model.shipdevice.ShipdevicePackage;
import net.cis.common.model.shipdevice.SlotSize;
import net.cis.common.model.shipdevice.SlotType;
import net.cis.common.model.spaceobject.SpaceobjectPackage;
import net.cis.common.model.spaceobject.impl.SpaceobjectPackageImpl;
import net.cis.common.model.structure.StructurePackage;
import net.cis.common.model.structure.impl.StructurePackageImpl;
import net.cis.common.model.universe.UniversePackage;
import net.cis.common.model.universe.impl.UniversePackageImpl;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class ShipdevicePackageImpl extends EPackageImpl implements ShipdevicePackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass abstractShipDeviceEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass engineDeviceEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass abstractWeaponEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass shieldDeviceEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass beamEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass massDriverEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass energyTorpedoEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass missileEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass pulseEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass abstractEnergyWeaponEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EEnum slotSizeEEnum = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EEnum slotTypeEEnum = null;
/**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
* <p>Note: the correct way to create the package is via the static
* factory method {@link #init init()}, which also performs
* initialization of the package, or returns the registered package,
* if one already exists.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.emf.ecore.EPackage.Registry
* @see net.cis.common.model.shipdevice.ShipdevicePackage#eNS_URI
* @see #init()
* @generated
*/
private ShipdevicePackageImpl() {
super(eNS_URI, ShipdeviceFactory.eINSTANCE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static boolean isInited = false;
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>This method is used to initialize {@link ShipdevicePackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static ShipdevicePackage init() {
if (isInited) return (ShipdevicePackage)EPackage.Registry.INSTANCE.getEPackage(ShipdevicePackage.eNS_URI);
// Obtain or create and register package
ShipdevicePackageImpl theShipdevicePackage = (ShipdevicePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ShipdevicePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ShipdevicePackageImpl());
isInited = true;
// Obtain or create and register interdependencies
BasePackageImpl theBasePackage = (BasePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(BasePackage.eNS_URI) instanceof BasePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(BasePackage.eNS_URI) : BasePackage.eINSTANCE);
ModelerPackageImpl theModelerPackage = (ModelerPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ModelerPackage.eNS_URI) instanceof ModelerPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ModelerPackage.eNS_URI) : ModelerPackage.eINSTANCE);
StructurePackageImpl theStructurePackage = (StructurePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(StructurePackage.eNS_URI) instanceof StructurePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(StructurePackage.eNS_URI) : StructurePackage.eINSTANCE);
DescriptorPackageImpl theDescriptorPackage = (DescriptorPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(DescriptorPackage.eNS_URI) instanceof DescriptorPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(DescriptorPackage.eNS_URI) : DescriptorPackage.eINSTANCE);
SectorPackageImpl theSectorPackage = (SectorPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(SectorPackage.eNS_URI) instanceof SectorPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(SectorPackage.eNS_URI) : SectorPackage.eINSTANCE);
SpaceobjectPackageImpl theSpaceobjectPackage = (SpaceobjectPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(SpaceobjectPackage.eNS_URI) instanceof SpaceobjectPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(SpaceobjectPackage.eNS_URI) : SpaceobjectPackage.eINSTANCE);
UniversePackageImpl theUniversePackage = (UniversePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(UniversePackage.eNS_URI) instanceof UniversePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(UniversePackage.eNS_URI) : UniversePackage.eINSTANCE);
// Create package meta-data objects
theShipdevicePackage.createPackageContents();
theBasePackage.createPackageContents();
theModelerPackage.createPackageContents();
theStructurePackage.createPackageContents();
theDescriptorPackage.createPackageContents();
theSectorPackage.createPackageContents();
theSpaceobjectPackage.createPackageContents();
theUniversePackage.createPackageContents();
// Initialize created meta-data
theShipdevicePackage.initializePackageContents();
theBasePackage.initializePackageContents();
theModelerPackage.initializePackageContents();
theStructurePackage.initializePackageContents();
theDescriptorPackage.initializePackageContents();
theSectorPackage.initializePackageContents();
theSpaceobjectPackage.initializePackageContents();
theUniversePackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theShipdevicePackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(ShipdevicePackage.eNS_URI, theShipdevicePackage);
return theShipdevicePackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getAbstractShipDevice() {
return abstractShipDeviceEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getAbstractShipDevice_Weight() {
return (EAttribute)abstractShipDeviceEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getAbstractShipDevice_Size() {
return (EAttribute)abstractShipDeviceEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getAbstractShipDevice_Type() {
return (EAttribute)abstractShipDeviceEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getEngineDevice() {
return engineDeviceEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getEngineDevice_Thrust() {
return (EAttribute)engineDeviceEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getAbstractWeapon() {
return abstractWeaponEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getAbstractWeapon_Power() {
return (EAttribute)abstractWeaponEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getAbstractWeapon_Range() {
return (EAttribute)abstractWeaponEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getShieldDevice() {
return shieldDeviceEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getShieldDevice_Strength() {
return (EAttribute)shieldDeviceEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getBeam() {
return beamEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getMassDriver() {
return massDriverEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getEnergyTorpedo() {
return energyTorpedoEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getMissile() {
return missileEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getPulse() {
return pulseEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getAbstractEnergyWeapon() {
return abstractEnergyWeaponEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EEnum getSlotSize() {
return slotSizeEEnum;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EEnum getSlotType() {
return slotTypeEEnum;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ShipdeviceFactory getShipdeviceFactory() {
return (ShipdeviceFactory)getEFactoryInstance();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isCreated = false;
/**
* Creates the meta-model objects for the package. This method is
* guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void createPackageContents() {
if (isCreated) return;
isCreated = true;
// Create classes and their features
abstractShipDeviceEClass = createEClass(ABSTRACT_SHIP_DEVICE);
createEAttribute(abstractShipDeviceEClass, ABSTRACT_SHIP_DEVICE__WEIGHT);
createEAttribute(abstractShipDeviceEClass, ABSTRACT_SHIP_DEVICE__SIZE);
createEAttribute(abstractShipDeviceEClass, ABSTRACT_SHIP_DEVICE__TYPE);
engineDeviceEClass = createEClass(ENGINE_DEVICE);
createEAttribute(engineDeviceEClass, ENGINE_DEVICE__THRUST);
abstractWeaponEClass = createEClass(ABSTRACT_WEAPON);
createEAttribute(abstractWeaponEClass, ABSTRACT_WEAPON__POWER);
createEAttribute(abstractWeaponEClass, ABSTRACT_WEAPON__RANGE);
shieldDeviceEClass = createEClass(SHIELD_DEVICE);
createEAttribute(shieldDeviceEClass, SHIELD_DEVICE__STRENGTH);
beamEClass = createEClass(BEAM);
massDriverEClass = createEClass(MASS_DRIVER);
energyTorpedoEClass = createEClass(ENERGY_TORPEDO);
missileEClass = createEClass(MISSILE);
pulseEClass = createEClass(PULSE);
abstractEnergyWeaponEClass = createEClass(ABSTRACT_ENERGY_WEAPON);
// Create enums
slotSizeEEnum = createEEnum(SLOT_SIZE);
slotTypeEEnum = createEEnum(SLOT_TYPE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isInitialized = false;
/**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void initializePackageContents() {
if (isInitialized) return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Obtain other dependent packages
BasePackage theBasePackage = (BasePackage)EPackage.Registry.INSTANCE.getEPackage(BasePackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
abstractShipDeviceEClass.getESuperTypes().add(theBasePackage.getAbstractNamedEntity());
engineDeviceEClass.getESuperTypes().add(this.getAbstractShipDevice());
abstractWeaponEClass.getESuperTypes().add(this.getAbstractShipDevice());
shieldDeviceEClass.getESuperTypes().add(this.getAbstractShipDevice());
beamEClass.getESuperTypes().add(this.getAbstractEnergyWeapon());
massDriverEClass.getESuperTypes().add(this.getAbstractWeapon());
energyTorpedoEClass.getESuperTypes().add(this.getAbstractEnergyWeapon());
missileEClass.getESuperTypes().add(this.getAbstractWeapon());
pulseEClass.getESuperTypes().add(this.getAbstractEnergyWeapon());
abstractEnergyWeaponEClass.getESuperTypes().add(this.getAbstractWeapon());
// Initialize classes and features; add operations and parameters
initEClass(abstractShipDeviceEClass, AbstractShipDevice.class, "AbstractShipDevice", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getAbstractShipDevice_Weight(), ecorePackage.getEFloat(), "weight", null, 1, 1, AbstractShipDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getAbstractShipDevice_Size(), this.getSlotSize(), "size", null, 1, 1, AbstractShipDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getAbstractShipDevice_Type(), this.getSlotType(), "type", null, 1, 1, AbstractShipDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(engineDeviceEClass, EngineDevice.class, "EngineDevice", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getEngineDevice_Thrust(), ecorePackage.getEFloat(), "thrust", null, 1, 1, EngineDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(abstractWeaponEClass, AbstractWeapon.class, "AbstractWeapon", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getAbstractWeapon_Power(), ecorePackage.getEInt(), "power", null, 1, 1, AbstractWeapon.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getAbstractWeapon_Range(), ecorePackage.getEFloat(), "range", null, 1, 1, AbstractWeapon.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(shieldDeviceEClass, ShieldDevice.class, "ShieldDevice", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getShieldDevice_Strength(), ecorePackage.getEInt(), "strength", null, 1, 1, ShieldDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(beamEClass, Beam.class, "Beam", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(massDriverEClass, MassDriver.class, "MassDriver", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(energyTorpedoEClass, EnergyTorpedo.class, "EnergyTorpedo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(missileEClass, Missile.class, "Missile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(pulseEClass, Pulse.class, "Pulse", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(abstractEnergyWeaponEClass, AbstractEnergyWeapon.class, "AbstractEnergyWeapon", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
// Initialize enums and add enum literals
initEEnum(slotSizeEEnum, SlotSize.class, "SlotSize");
addEEnumLiteral(slotSizeEEnum, SlotSize.TINY);
addEEnumLiteral(slotSizeEEnum, SlotSize.SMALL);
addEEnumLiteral(slotSizeEEnum, SlotSize.MEDIUM);
addEEnumLiteral(slotSizeEEnum, SlotSize.TALL);
addEEnumLiteral(slotSizeEEnum, SlotSize.HUGE);
initEEnum(slotTypeEEnum, SlotType.class, "SlotType");
addEEnumLiteral(slotTypeEEnum, SlotType.SHIELD);
addEEnumLiteral(slotTypeEEnum, SlotType.ENGINE);
addEEnumLiteral(slotTypeEEnum, SlotType.WEAPON);
// Create resource
createResource(eNS_URI);
}
} //ShipdevicePackageImpl