/** * generated by Xtext 2.23.0 */ package xtext.game.impl; 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.EDataTypeEList; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import xtext.game.Condition; import xtext.game.Description; import xtext.game.GamePackage; import xtext.game.Lieu; /** * * An implementation of the model object 'Lieu'. * *

* The following features are implemented: *

* * * @generated */ public class LieuImpl extends MinimalEObjectImpl.Container implements Lieu { /** * The default value of the '{@link #getNom() Nom}' attribute. * * * @see #getNom() * @generated * @ordered */ protected static final String NOM_EDEFAULT = null; /** * The cached value of the '{@link #getNom() Nom}' attribute. * * * @see #getNom() * @generated * @ordered */ protected String nom = NOM_EDEFAULT; /** * The cached value of the '{@link #getDeposable() Deposable}' containment reference. * * * @see #getDeposable() * @generated * @ordered */ protected Condition deposable; /** * The cached value of the '{@link #getDepart() Depart}' containment reference. * * * @see #getDepart() * @generated * @ordered */ protected Condition depart; /** * The cached value of the '{@link #getFin() Fin}' containment reference. * * * @see #getFin() * @generated * @ordered */ protected Condition fin; /** * The cached value of the '{@link #getPersonnes() Personnes}' attribute list. * * * @see #getPersonnes() * @generated * @ordered */ protected EList personnes; /** * The cached value of the '{@link #getDescriptions() Descriptions}' containment reference list. * * * @see #getDescriptions() * @generated * @ordered */ protected EList descriptions; /** * The cached value of the '{@link #getObjets() Objets}' attribute list. * * * @see #getObjets() * @generated * @ordered */ protected EList objets; /** * The cached value of the '{@link #getConnaissances() Connaissances}' attribute list. * * * @see #getConnaissances() * @generated * @ordered */ protected EList connaissances; /** * * * @generated */ protected LieuImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return GamePackage.Literals.LIEU; } /** * * * @generated */ @Override public String getNom() { return nom; } /** * * * @generated */ @Override public void setNom(String newNom) { String oldNom = nom; nom = newNom; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.LIEU__NOM, oldNom, nom)); } /** * * * @generated */ @Override public Condition getDeposable() { return deposable; } /** * * * @generated */ public NotificationChain basicSetDeposable(Condition newDeposable, NotificationChain msgs) { Condition oldDeposable = deposable; deposable = newDeposable; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GamePackage.LIEU__DEPOSABLE, oldDeposable, newDeposable); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setDeposable(Condition newDeposable) { if (newDeposable != deposable) { NotificationChain msgs = null; if (deposable != null) msgs = ((InternalEObject)deposable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GamePackage.LIEU__DEPOSABLE, null, msgs); if (newDeposable != null) msgs = ((InternalEObject)newDeposable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GamePackage.LIEU__DEPOSABLE, null, msgs); msgs = basicSetDeposable(newDeposable, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.LIEU__DEPOSABLE, newDeposable, newDeposable)); } /** * * * @generated */ @Override public Condition getDepart() { return depart; } /** * * * @generated */ public NotificationChain basicSetDepart(Condition newDepart, NotificationChain msgs) { Condition oldDepart = depart; depart = newDepart; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GamePackage.LIEU__DEPART, oldDepart, newDepart); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setDepart(Condition newDepart) { if (newDepart != depart) { NotificationChain msgs = null; if (depart != null) msgs = ((InternalEObject)depart).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GamePackage.LIEU__DEPART, null, msgs); if (newDepart != null) msgs = ((InternalEObject)newDepart).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GamePackage.LIEU__DEPART, null, msgs); msgs = basicSetDepart(newDepart, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.LIEU__DEPART, newDepart, newDepart)); } /** * * * @generated */ @Override public Condition getFin() { return fin; } /** * * * @generated */ public NotificationChain basicSetFin(Condition newFin, NotificationChain msgs) { Condition oldFin = fin; fin = newFin; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GamePackage.LIEU__FIN, oldFin, newFin); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setFin(Condition newFin) { if (newFin != fin) { NotificationChain msgs = null; if (fin != null) msgs = ((InternalEObject)fin).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GamePackage.LIEU__FIN, null, msgs); if (newFin != null) msgs = ((InternalEObject)newFin).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GamePackage.LIEU__FIN, null, msgs); msgs = basicSetFin(newFin, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.LIEU__FIN, newFin, newFin)); } /** * * * @generated */ @Override public EList getPersonnes() { if (personnes == null) { personnes = new EDataTypeEList(String.class, this, GamePackage.LIEU__PERSONNES); } return personnes; } /** * * * @generated */ @Override public EList getDescriptions() { if (descriptions == null) { descriptions = new EObjectContainmentEList(Description.class, this, GamePackage.LIEU__DESCRIPTIONS); } return descriptions; } /** * * * @generated */ @Override public EList getObjets() { if (objets == null) { objets = new EDataTypeEList(String.class, this, GamePackage.LIEU__OBJETS); } return objets; } /** * * * @generated */ @Override public EList getConnaissances() { if (connaissances == null) { connaissances = new EDataTypeEList(String.class, this, GamePackage.LIEU__CONNAISSANCES); } return connaissances; } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case GamePackage.LIEU__DEPOSABLE: return basicSetDeposable(null, msgs); case GamePackage.LIEU__DEPART: return basicSetDepart(null, msgs); case GamePackage.LIEU__FIN: return basicSetFin(null, msgs); case GamePackage.LIEU__DESCRIPTIONS: return ((InternalEList)getDescriptions()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case GamePackage.LIEU__NOM: return getNom(); case GamePackage.LIEU__DEPOSABLE: return getDeposable(); case GamePackage.LIEU__DEPART: return getDepart(); case GamePackage.LIEU__FIN: return getFin(); case GamePackage.LIEU__PERSONNES: return getPersonnes(); case GamePackage.LIEU__DESCRIPTIONS: return getDescriptions(); case GamePackage.LIEU__OBJETS: return getObjets(); case GamePackage.LIEU__CONNAISSANCES: return getConnaissances(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case GamePackage.LIEU__NOM: setNom((String)newValue); return; case GamePackage.LIEU__DEPOSABLE: setDeposable((Condition)newValue); return; case GamePackage.LIEU__DEPART: setDepart((Condition)newValue); return; case GamePackage.LIEU__FIN: setFin((Condition)newValue); return; case GamePackage.LIEU__PERSONNES: getPersonnes().clear(); getPersonnes().addAll((Collection)newValue); return; case GamePackage.LIEU__DESCRIPTIONS: getDescriptions().clear(); getDescriptions().addAll((Collection)newValue); return; case GamePackage.LIEU__OBJETS: getObjets().clear(); getObjets().addAll((Collection)newValue); return; case GamePackage.LIEU__CONNAISSANCES: getConnaissances().clear(); getConnaissances().addAll((Collection)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case GamePackage.LIEU__NOM: setNom(NOM_EDEFAULT); return; case GamePackage.LIEU__DEPOSABLE: setDeposable((Condition)null); return; case GamePackage.LIEU__DEPART: setDepart((Condition)null); return; case GamePackage.LIEU__FIN: setFin((Condition)null); return; case GamePackage.LIEU__PERSONNES: getPersonnes().clear(); return; case GamePackage.LIEU__DESCRIPTIONS: getDescriptions().clear(); return; case GamePackage.LIEU__OBJETS: getObjets().clear(); return; case GamePackage.LIEU__CONNAISSANCES: getConnaissances().clear(); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case GamePackage.LIEU__NOM: return NOM_EDEFAULT == null ? nom != null : !NOM_EDEFAULT.equals(nom); case GamePackage.LIEU__DEPOSABLE: return deposable != null; case GamePackage.LIEU__DEPART: return depart != null; case GamePackage.LIEU__FIN: return fin != null; case GamePackage.LIEU__PERSONNES: return personnes != null && !personnes.isEmpty(); case GamePackage.LIEU__DESCRIPTIONS: return descriptions != null && !descriptions.isEmpty(); case GamePackage.LIEU__OBJETS: return objets != null && !objets.isEmpty(); case GamePackage.LIEU__CONNAISSANCES: return connaissances != null && !connaissances.isEmpty(); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (nom: "); result.append(nom); result.append(", personnes: "); result.append(personnes); result.append(", objets: "); result.append(objets); result.append(", connaissances: "); result.append(connaissances); result.append(')'); return result.toString(); } } //LieuImpl