/** * generated by Xtext 2.23.0 */ package fr.n7.game.impl; import fr.n7.game.Connaissance; import fr.n7.game.Explorateur; import fr.n7.game.GamePackage; import fr.n7.game.Jeu; import fr.n7.game.Objet; import fr.n7.game.Personne; import fr.n7.game.Territoire; import fr.n7.game.Transformation; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * * An implementation of the model object 'Jeu'. * *

* The following features are implemented: *

* * * @generated */ public class JeuImpl extends MinimalEObjectImpl.Container implements Jeu { /** * The cached value of the '{@link #getExplorateur() Explorateur}' containment reference. * * * @see #getExplorateur() * @generated * @ordered */ protected Explorateur explorateur; /** * The cached value of the '{@link #getTerritoire() Territoire}' containment reference. * * * @see #getTerritoire() * @generated * @ordered */ protected Territoire territoire; /** * The cached value of the '{@link #getObjets() Objets}' containment reference list. * * * @see #getObjets() * @generated * @ordered */ protected EList objets; /** * The cached value of the '{@link #getConnaissances() Connaissances}' containment reference list. * * * @see #getConnaissances() * @generated * @ordered */ protected EList connaissances; /** * The cached value of the '{@link #getPersonnes() Personnes}' containment reference list. * * * @see #getPersonnes() * @generated * @ordered */ protected EList personnes; /** * The cached value of the '{@link #getTransformations() Transformations}' containment reference list. * * * @see #getTransformations() * @generated * @ordered */ protected EList transformations; /** * * * @generated */ protected JeuImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return GamePackage.Literals.JEU; } /** * * * @generated */ @Override public Explorateur getExplorateur() { return explorateur; } /** * * * @generated */ public NotificationChain basicSetExplorateur(Explorateur newExplorateur, NotificationChain msgs) { Explorateur oldExplorateur = explorateur; explorateur = newExplorateur; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GamePackage.JEU__EXPLORATEUR, oldExplorateur, newExplorateur); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setExplorateur(Explorateur newExplorateur) { if (newExplorateur != explorateur) { NotificationChain msgs = null; if (explorateur != null) msgs = ((InternalEObject)explorateur).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GamePackage.JEU__EXPLORATEUR, null, msgs); if (newExplorateur != null) msgs = ((InternalEObject)newExplorateur).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GamePackage.JEU__EXPLORATEUR, null, msgs); msgs = basicSetExplorateur(newExplorateur, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.JEU__EXPLORATEUR, newExplorateur, newExplorateur)); } /** * * * @generated */ @Override public Territoire getTerritoire() { return territoire; } /** * * * @generated */ public NotificationChain basicSetTerritoire(Territoire newTerritoire, NotificationChain msgs) { Territoire oldTerritoire = territoire; territoire = newTerritoire; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GamePackage.JEU__TERRITOIRE, oldTerritoire, newTerritoire); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setTerritoire(Territoire newTerritoire) { if (newTerritoire != territoire) { NotificationChain msgs = null; if (territoire != null) msgs = ((InternalEObject)territoire).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GamePackage.JEU__TERRITOIRE, null, msgs); if (newTerritoire != null) msgs = ((InternalEObject)newTerritoire).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GamePackage.JEU__TERRITOIRE, null, msgs); msgs = basicSetTerritoire(newTerritoire, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.JEU__TERRITOIRE, newTerritoire, newTerritoire)); } /** * * * @generated */ @Override public EList getObjets() { if (objets == null) { objets = new EObjectContainmentEList(Objet.class, this, GamePackage.JEU__OBJETS); } return objets; } /** * * * @generated */ @Override public EList getConnaissances() { if (connaissances == null) { connaissances = new EObjectContainmentEList(Connaissance.class, this, GamePackage.JEU__CONNAISSANCES); } return connaissances; } /** * * * @generated */ @Override public EList getPersonnes() { if (personnes == null) { personnes = new EObjectContainmentEList(Personne.class, this, GamePackage.JEU__PERSONNES); } return personnes; } /** * * * @generated */ @Override public EList getTransformations() { if (transformations == null) { transformations = new EObjectContainmentEList(Transformation.class, this, GamePackage.JEU__TRANSFORMATIONS); } return transformations; } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case GamePackage.JEU__EXPLORATEUR: return basicSetExplorateur(null, msgs); case GamePackage.JEU__TERRITOIRE: return basicSetTerritoire(null, msgs); case GamePackage.JEU__OBJETS: return ((InternalEList)getObjets()).basicRemove(otherEnd, msgs); case GamePackage.JEU__CONNAISSANCES: return ((InternalEList)getConnaissances()).basicRemove(otherEnd, msgs); case GamePackage.JEU__PERSONNES: return ((InternalEList)getPersonnes()).basicRemove(otherEnd, msgs); case GamePackage.JEU__TRANSFORMATIONS: return ((InternalEList)getTransformations()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case GamePackage.JEU__EXPLORATEUR: return getExplorateur(); case GamePackage.JEU__TERRITOIRE: return getTerritoire(); case GamePackage.JEU__OBJETS: return getObjets(); case GamePackage.JEU__CONNAISSANCES: return getConnaissances(); case GamePackage.JEU__PERSONNES: return getPersonnes(); case GamePackage.JEU__TRANSFORMATIONS: return getTransformations(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case GamePackage.JEU__EXPLORATEUR: setExplorateur((Explorateur)newValue); return; case GamePackage.JEU__TERRITOIRE: setTerritoire((Territoire)newValue); return; case GamePackage.JEU__OBJETS: getObjets().clear(); getObjets().addAll((Collection)newValue); return; case GamePackage.JEU__CONNAISSANCES: getConnaissances().clear(); getConnaissances().addAll((Collection)newValue); return; case GamePackage.JEU__PERSONNES: getPersonnes().clear(); getPersonnes().addAll((Collection)newValue); return; case GamePackage.JEU__TRANSFORMATIONS: getTransformations().clear(); getTransformations().addAll((Collection)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case GamePackage.JEU__EXPLORATEUR: setExplorateur((Explorateur)null); return; case GamePackage.JEU__TERRITOIRE: setTerritoire((Territoire)null); return; case GamePackage.JEU__OBJETS: getObjets().clear(); return; case GamePackage.JEU__CONNAISSANCES: getConnaissances().clear(); return; case GamePackage.JEU__PERSONNES: getPersonnes().clear(); return; case GamePackage.JEU__TRANSFORMATIONS: getTransformations().clear(); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case GamePackage.JEU__EXPLORATEUR: return explorateur != null; case GamePackage.JEU__TERRITOIRE: return territoire != null; case GamePackage.JEU__OBJETS: return objets != null && !objets.isEmpty(); case GamePackage.JEU__CONNAISSANCES: return connaissances != null && !connaissances.isEmpty(); case GamePackage.JEU__PERSONNES: return personnes != null && !personnes.isEmpty(); case GamePackage.JEU__TRANSFORMATIONS: return transformations != null && !transformations.isEmpty(); } return super.eIsSet(featureID); } } //JeuImpl