projet-genie-logiciel-systeme/workspace/fr.n7.game/src-gen/fr/n7/gAME/impl/JeuImpl.java

440 lines
12 KiB
Java
Raw Normal View History

2021-11-30 17:25:45 +00:00
/**
* generated by Xtext 2.23.0
*/
2021-12-03 08:38:29 +00:00
package fr.n7.gAME.impl;
2021-12-03 07:37:31 +00:00
2021-12-03 08:38:29 +00:00
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;
2021-11-30 17:25:45 +00:00
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>
2021-12-03 08:38:29 +00:00
* <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>
2021-11-30 17:25:45 +00:00
* </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()
{
2021-12-03 08:38:29 +00:00
return GAMEPackage.Literals.JEU;
2021-11-30 17:25:45 +00:00
}
/**
* <!-- 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())
{
2021-12-03 08:38:29 +00:00
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.JEU__EXPLORATEUR, oldExplorateur, newExplorateur);
2021-11-30 17:25:45 +00:00
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)
2021-12-03 08:38:29 +00:00
msgs = ((InternalEObject)explorateur).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.JEU__EXPLORATEUR, null, msgs);
2021-11-30 17:25:45 +00:00
if (newExplorateur != null)
2021-12-03 08:38:29 +00:00
msgs = ((InternalEObject)newExplorateur).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.JEU__EXPLORATEUR, null, msgs);
2021-11-30 17:25:45 +00:00
msgs = basicSetExplorateur(newExplorateur, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
2021-12-03 08:38:29 +00:00
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.JEU__EXPLORATEUR, newExplorateur, newExplorateur));
2021-11-30 17:25:45 +00:00
}
/**
* <!-- 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())
{
2021-12-03 08:38:29 +00:00
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.JEU__TERRITOIRE, oldTerritoire, newTerritoire);
2021-11-30 17:25:45 +00:00
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)
2021-12-03 08:38:29 +00:00
msgs = ((InternalEObject)territoire).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.JEU__TERRITOIRE, null, msgs);
2021-11-30 17:25:45 +00:00
if (newTerritoire != null)
2021-12-03 08:38:29 +00:00
msgs = ((InternalEObject)newTerritoire).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.JEU__TERRITOIRE, null, msgs);
2021-11-30 17:25:45 +00:00
msgs = basicSetTerritoire(newTerritoire, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
2021-12-03 08:38:29 +00:00
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.JEU__TERRITOIRE, newTerritoire, newTerritoire));
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Objet> getObjets()
{
if (objets == null)
{
2021-12-03 08:38:29 +00:00
objets = new EObjectContainmentEList<Objet>(Objet.class, this, GAMEPackage.JEU__OBJETS);
2021-11-30 17:25:45 +00:00
}
return objets;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Connaissance> getConnaissances()
{
if (connaissances == null)
{
2021-12-03 08:38:29 +00:00
connaissances = new EObjectContainmentEList<Connaissance>(Connaissance.class, this, GAMEPackage.JEU__CONNAISSANCES);
2021-11-30 17:25:45 +00:00
}
return connaissances;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Personne> getPersonnes()
{
if (personnes == null)
{
2021-12-03 08:38:29 +00:00
personnes = new EObjectContainmentEList<Personne>(Personne.class, this, GAMEPackage.JEU__PERSONNES);
2021-11-30 17:25:45 +00:00
}
return personnes;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Transformation> getTransformations()
{
if (transformations == null)
{
2021-12-03 08:38:29 +00:00
transformations = new EObjectContainmentEList<Transformation>(Transformation.class, this, GAMEPackage.JEU__TRANSFORMATIONS);
2021-11-30 17:25:45 +00:00
}
return transformations;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__EXPLORATEUR:
2021-11-30 17:25:45 +00:00
return basicSetExplorateur(null, msgs);
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__TERRITOIRE:
2021-11-30 17:25:45 +00:00
return basicSetTerritoire(null, msgs);
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__OBJETS:
2021-11-30 17:25:45 +00:00
return ((InternalEList<?>)getObjets()).basicRemove(otherEnd, msgs);
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__CONNAISSANCES:
2021-11-30 17:25:45 +00:00
return ((InternalEList<?>)getConnaissances()).basicRemove(otherEnd, msgs);
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__PERSONNES:
2021-11-30 17:25:45 +00:00
return ((InternalEList<?>)getPersonnes()).basicRemove(otherEnd, msgs);
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__TRANSFORMATIONS:
2021-11-30 17:25:45 +00:00
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)
{
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__EXPLORATEUR:
2021-11-30 17:25:45 +00:00
return getExplorateur();
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__TERRITOIRE:
2021-11-30 17:25:45 +00:00
return getTerritoire();
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__OBJETS:
2021-11-30 17:25:45 +00:00
return getObjets();
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__CONNAISSANCES:
2021-11-30 17:25:45 +00:00
return getConnaissances();
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__PERSONNES:
2021-11-30 17:25:45 +00:00
return getPersonnes();
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__TRANSFORMATIONS:
2021-11-30 17:25:45 +00:00
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)
{
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__EXPLORATEUR:
2021-11-30 17:25:45 +00:00
setExplorateur((Explorateur)newValue);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__TERRITOIRE:
2021-11-30 17:25:45 +00:00
setTerritoire((Territoire)newValue);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__OBJETS:
2021-11-30 17:25:45 +00:00
getObjets().clear();
getObjets().addAll((Collection<? extends Objet>)newValue);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__CONNAISSANCES:
2021-11-30 17:25:45 +00:00
getConnaissances().clear();
getConnaissances().addAll((Collection<? extends Connaissance>)newValue);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__PERSONNES:
2021-11-30 17:25:45 +00:00
getPersonnes().clear();
getPersonnes().addAll((Collection<? extends Personne>)newValue);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__TRANSFORMATIONS:
2021-11-30 17:25:45 +00:00
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)
{
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__EXPLORATEUR:
2021-11-30 17:25:45 +00:00
setExplorateur((Explorateur)null);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__TERRITOIRE:
2021-11-30 17:25:45 +00:00
setTerritoire((Territoire)null);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__OBJETS:
2021-11-30 17:25:45 +00:00
getObjets().clear();
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__CONNAISSANCES:
2021-11-30 17:25:45 +00:00
getConnaissances().clear();
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__PERSONNES:
2021-11-30 17:25:45 +00:00
getPersonnes().clear();
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__TRANSFORMATIONS:
2021-11-30 17:25:45 +00:00
getTransformations().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__EXPLORATEUR:
2021-11-30 17:25:45 +00:00
return explorateur != null;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__TERRITOIRE:
2021-11-30 17:25:45 +00:00
return territoire != null;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__OBJETS:
2021-11-30 17:25:45 +00:00
return objets != null && !objets.isEmpty();
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__CONNAISSANCES:
2021-11-30 17:25:45 +00:00
return connaissances != null && !connaissances.isEmpty();
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__PERSONNES:
2021-11-30 17:25:45 +00:00
return personnes != null && !personnes.isEmpty();
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU__TRANSFORMATIONS:
2021-11-30 17:25:45 +00:00
return transformations != null && !transformations.isEmpty();
}
return super.eIsSet(featureID);
}
} //JeuImpl