440 lines
12 KiB
Java
440 lines
12 KiB
Java
/**
|
|
* 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;
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* An implementation of the model object '<em><b>Jeu</b></em>'.
|
|
* <!-- end-user-doc -->
|
|
* <p>
|
|
* The following features are implemented:
|
|
* </p>
|
|
* <ul>
|
|
* <li>{@link fr.n7.gAME.impl.JeuImpl#getExplorateur <em>Explorateur</em>}</li>
|
|
* <li>{@link fr.n7.gAME.impl.JeuImpl#getTerritoire <em>Territoire</em>}</li>
|
|
* <li>{@link fr.n7.gAME.impl.JeuImpl#getObjets <em>Objets</em>}</li>
|
|
* <li>{@link fr.n7.gAME.impl.JeuImpl#getConnaissances <em>Connaissances</em>}</li>
|
|
* <li>{@link fr.n7.gAME.impl.JeuImpl#getPersonnes <em>Personnes</em>}</li>
|
|
* <li>{@link fr.n7.gAME.impl.JeuImpl#getTransformations <em>Transformations</em>}</li>
|
|
* </ul>
|
|
*
|
|
* @generated
|
|
*/
|
|
public class JeuImpl extends MinimalEObjectImpl.Container implements Jeu
|
|
{
|
|
/**
|
|
* The cached value of the '{@link #getExplorateur() <em>Explorateur</em>}' containment reference.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getExplorateur()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected Explorateur explorateur;
|
|
|
|
/**
|
|
* The cached value of the '{@link #getTerritoire() <em>Territoire</em>}' containment reference.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getTerritoire()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected Territoire territoire;
|
|
|
|
/**
|
|
* The cached value of the '{@link #getObjets() <em>Objets</em>}' containment reference list.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getObjets()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected EList<Objet> objets;
|
|
|
|
/**
|
|
* The cached value of the '{@link #getConnaissances() <em>Connaissances</em>}' containment reference list.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getConnaissances()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected EList<Connaissance> connaissances;
|
|
|
|
/**
|
|
* The cached value of the '{@link #getPersonnes() <em>Personnes</em>}' containment reference list.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getPersonnes()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected EList<Personne> personnes;
|
|
|
|
/**
|
|
* The cached value of the '{@link #getTransformations() <em>Transformations</em>}' containment reference list.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getTransformations()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected EList<Transformation> transformations;
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
protected JeuImpl()
|
|
{
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
protected EClass eStaticClass()
|
|
{
|
|
return GAMEPackage.Literals.JEU;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public Explorateur getExplorateur()
|
|
{
|
|
return explorateur;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @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;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @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));
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public Territoire getTerritoire()
|
|
{
|
|
return territoire;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @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;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @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));
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EList<Objet> getObjets()
|
|
{
|
|
if (objets == null)
|
|
{
|
|
objets = new EObjectContainmentEList<Objet>(Objet.class, this, GAMEPackage.JEU__OBJETS);
|
|
}
|
|
return objets;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EList<Connaissance> getConnaissances()
|
|
{
|
|
if (connaissances == null)
|
|
{
|
|
connaissances = new EObjectContainmentEList<Connaissance>(Connaissance.class, this, GAMEPackage.JEU__CONNAISSANCES);
|
|
}
|
|
return connaissances;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EList<Personne> getPersonnes()
|
|
{
|
|
if (personnes == null)
|
|
{
|
|
personnes = new EObjectContainmentEList<Personne>(Personne.class, this, GAMEPackage.JEU__PERSONNES);
|
|
}
|
|
return personnes;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EList<Transformation> getTransformations()
|
|
{
|
|
if (transformations == null)
|
|
{
|
|
transformations = new EObjectContainmentEList<Transformation>(Transformation.class, this, GAMEPackage.JEU__TRANSFORMATIONS);
|
|
}
|
|
return transformations;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @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);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @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);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @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<? extends Objet>)newValue);
|
|
return;
|
|
case GAMEPackage.JEU__CONNAISSANCES:
|
|
getConnaissances().clear();
|
|
getConnaissances().addAll((Collection<? extends Connaissance>)newValue);
|
|
return;
|
|
case GAMEPackage.JEU__PERSONNES:
|
|
getPersonnes().clear();
|
|
getPersonnes().addAll((Collection<? extends Personne>)newValue);
|
|
return;
|
|
case GAMEPackage.JEU__TRANSFORMATIONS:
|
|
getTransformations().clear();
|
|
getTransformations().addAll((Collection<? extends Transformation>)newValue);
|
|
return;
|
|
}
|
|
super.eSet(featureID, newValue);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @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);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @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
|