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

583 lines
15 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.Condition;
import fr.n7.gAME.Description;
import fr.n7.gAME.GAMEPackage;
import fr.n7.gAME.Lieu;
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.EDataTypeEList;
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>Lieu</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.LieuImpl#getNom <em>Nom</em>}</li>
* <li>{@link fr.n7.gAME.impl.LieuImpl#getDeposable <em>Deposable</em>}</li>
* <li>{@link fr.n7.gAME.impl.LieuImpl#getDepart <em>Depart</em>}</li>
* <li>{@link fr.n7.gAME.impl.LieuImpl#getFin <em>Fin</em>}</li>
* <li>{@link fr.n7.gAME.impl.LieuImpl#getPersonnes <em>Personnes</em>}</li>
* <li>{@link fr.n7.gAME.impl.LieuImpl#getDescriptions <em>Descriptions</em>}</li>
* <li>{@link fr.n7.gAME.impl.LieuImpl#getObjets <em>Objets</em>}</li>
* <li>{@link fr.n7.gAME.impl.LieuImpl#getConnaissances <em>Connaissances</em>}</li>
2021-11-30 17:25:45 +00:00
* </ul>
*
* @generated
*/
public class LieuImpl extends MinimalEObjectImpl.Container implements Lieu
{
/**
* The default value of the '{@link #getNom() <em>Nom</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNom()
* @generated
* @ordered
*/
protected static final String NOM_EDEFAULT = null;
/**
* The cached value of the '{@link #getNom() <em>Nom</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNom()
* @generated
* @ordered
*/
protected String nom = NOM_EDEFAULT;
/**
* The cached value of the '{@link #getDeposable() <em>Deposable</em>}' containment reference.
2021-11-30 17:25:45 +00:00
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDeposable()
2021-11-30 17:25:45 +00:00
* @generated
* @ordered
*/
protected Condition deposable;
2021-11-30 17:25:45 +00:00
/**
* The cached value of the '{@link #getDepart() <em>Depart</em>}' containment reference.
2021-11-30 17:25:45 +00:00
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDepart()
2021-11-30 17:25:45 +00:00
* @generated
* @ordered
*/
protected Condition depart;
2021-11-30 17:25:45 +00:00
/**
* The cached value of the '{@link #getFin() <em>Fin</em>}' containment reference.
2021-11-30 17:25:45 +00:00
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFin()
2021-11-30 17:25:45 +00:00
* @generated
* @ordered
*/
protected Condition fin;
2021-11-30 17:25:45 +00:00
/**
* The cached value of the '{@link #getPersonnes() <em>Personnes</em>}' attribute list.
2021-11-30 17:25:45 +00:00
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPersonnes()
2021-11-30 17:25:45 +00:00
* @generated
* @ordered
*/
protected EList<String> personnes;
2021-11-30 17:25:45 +00:00
/**
* The cached value of the '{@link #getDescriptions() <em>Descriptions</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescriptions()
* @generated
* @ordered
*/
protected EList<Description> descriptions;
/**
* The cached value of the '{@link #getObjets() <em>Objets</em>}' attribute list.
2021-11-30 17:25:45 +00:00
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObjets()
2021-11-30 17:25:45 +00:00
* @generated
* @ordered
*/
protected EList<String> objets;
2021-11-30 17:25:45 +00:00
/**
* The cached value of the '{@link #getConnaissances() <em>Connaissances</em>}' attribute list.
2021-11-30 17:25:45 +00:00
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getConnaissances()
2021-11-30 17:25:45 +00:00
* @generated
* @ordered
*/
protected EList<String> connaissances;
2021-11-30 17:25:45 +00:00
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LieuImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
2021-12-03 08:38:29 +00:00
return GAMEPackage.Literals.LIEU;
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getNom()
{
return nom;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setNom(String newNom)
{
String oldNom = nom;
nom = newNom;
if (eNotificationRequired())
2021-12-03 08:38:29 +00:00
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__NOM, oldNom, nom));
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Condition getDeposable()
{
return deposable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDeposable(Condition newDeposable, NotificationChain msgs)
{
Condition oldDeposable = deposable;
deposable = newDeposable;
if (eNotificationRequired())
{
2021-12-03 08:38:29 +00:00
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__DEPOSABLE, oldDeposable, newDeposable);
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 setDeposable(Condition newDeposable)
{
if (newDeposable != deposable)
{
NotificationChain msgs = null;
if (deposable != null)
2021-12-03 08:38:29 +00:00
msgs = ((InternalEObject)deposable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.LIEU__DEPOSABLE, null, msgs);
2021-11-30 17:25:45 +00:00
if (newDeposable != null)
2021-12-03 08:38:29 +00:00
msgs = ((InternalEObject)newDeposable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.LIEU__DEPOSABLE, null, msgs);
2021-11-30 17:25:45 +00:00
msgs = basicSetDeposable(newDeposable, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
2021-12-03 08:38:29 +00:00
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__DEPOSABLE, newDeposable, newDeposable));
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Condition getDepart()
{
return depart;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDepart(Condition newDepart, NotificationChain msgs)
{
Condition oldDepart = depart;
depart = newDepart;
if (eNotificationRequired())
{
2021-12-03 08:38:29 +00:00
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__DEPART, oldDepart, newDepart);
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 setDepart(Condition newDepart)
{
if (newDepart != depart)
{
NotificationChain msgs = null;
if (depart != null)
2021-12-03 08:38:29 +00:00
msgs = ((InternalEObject)depart).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.LIEU__DEPART, null, msgs);
2021-11-30 17:25:45 +00:00
if (newDepart != null)
2021-12-03 08:38:29 +00:00
msgs = ((InternalEObject)newDepart).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.LIEU__DEPART, null, msgs);
2021-11-30 17:25:45 +00:00
msgs = basicSetDepart(newDepart, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
2021-12-03 08:38:29 +00:00
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__DEPART, newDepart, newDepart));
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Condition getFin()
{
return fin;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetFin(Condition newFin, NotificationChain msgs)
{
Condition oldFin = fin;
fin = newFin;
if (eNotificationRequired())
{
2021-12-03 08:38:29 +00:00
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__FIN, oldFin, newFin);
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 setFin(Condition newFin)
{
if (newFin != fin)
{
NotificationChain msgs = null;
if (fin != null)
2021-12-03 08:38:29 +00:00
msgs = ((InternalEObject)fin).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.LIEU__FIN, null, msgs);
2021-11-30 17:25:45 +00:00
if (newFin != null)
2021-12-03 08:38:29 +00:00
msgs = ((InternalEObject)newFin).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.LIEU__FIN, null, msgs);
2021-11-30 17:25:45 +00:00
msgs = basicSetFin(newFin, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
2021-12-03 08:38:29 +00:00
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__FIN, newFin, newFin));
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<String> getPersonnes()
{
if (personnes == null)
{
2021-12-03 08:38:29 +00:00
personnes = new EDataTypeEList<String>(String.class, this, GAMEPackage.LIEU__PERSONNES);
}
return personnes;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Description> getDescriptions()
{
if (descriptions == null)
{
2021-12-03 08:38:29 +00:00
descriptions = new EObjectContainmentEList<Description>(Description.class, this, GAMEPackage.LIEU__DESCRIPTIONS);
}
return descriptions;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<String> getObjets()
{
if (objets == null)
{
2021-12-03 08:38:29 +00:00
objets = new EDataTypeEList<String>(String.class, this, GAMEPackage.LIEU__OBJETS);
}
return objets;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<String> getConnaissances()
{
if (connaissances == null)
{
2021-12-03 08:38:29 +00:00
connaissances = new EDataTypeEList<String>(String.class, this, GAMEPackage.LIEU__CONNAISSANCES);
}
return connaissances;
}
2021-11-30 17:25:45 +00:00
/**
* <!-- 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.LIEU__DEPOSABLE:
2021-11-30 17:25:45 +00:00
return basicSetDeposable(null, msgs);
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DEPART:
2021-11-30 17:25:45 +00:00
return basicSetDepart(null, msgs);
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__FIN:
2021-11-30 17:25:45 +00:00
return basicSetFin(null, msgs);
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DESCRIPTIONS:
return ((InternalEList<?>)getDescriptions()).basicRemove(otherEnd, msgs);
2021-11-30 17:25:45 +00:00
}
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.LIEU__NOM:
2021-11-30 17:25:45 +00:00
return getNom();
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DEPOSABLE:
2021-11-30 17:25:45 +00:00
return getDeposable();
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DEPART:
2021-11-30 17:25:45 +00:00
return getDepart();
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__FIN:
2021-11-30 17:25:45 +00:00
return getFin();
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__PERSONNES:
return getPersonnes();
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DESCRIPTIONS:
return getDescriptions();
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__OBJETS:
return getObjets();
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__CONNAISSANCES:
return getConnaissances();
2021-11-30 17:25:45 +00:00
}
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.LIEU__NOM:
2021-11-30 17:25:45 +00:00
setNom((String)newValue);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DEPOSABLE:
setDeposable((Condition)newValue);
2021-11-30 17:25:45 +00:00
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DEPART:
setDepart((Condition)newValue);
2021-11-30 17:25:45 +00:00
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__FIN:
setFin((Condition)newValue);
2021-11-30 17:25:45 +00:00
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__PERSONNES:
getPersonnes().clear();
getPersonnes().addAll((Collection<? extends String>)newValue);
2021-11-30 17:25:45 +00:00
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DESCRIPTIONS:
2021-11-30 17:25:45 +00:00
getDescriptions().clear();
getDescriptions().addAll((Collection<? extends Description>)newValue);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__OBJETS:
getObjets().clear();
getObjets().addAll((Collection<? extends String>)newValue);
2021-11-30 17:25:45 +00:00
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__CONNAISSANCES:
getConnaissances().clear();
getConnaissances().addAll((Collection<? extends String>)newValue);
2021-11-30 17:25:45 +00:00
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.LIEU__NOM:
2021-11-30 17:25:45 +00:00
setNom(NOM_EDEFAULT);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DEPOSABLE:
2021-11-30 17:25:45 +00:00
setDeposable((Condition)null);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DEPART:
2021-11-30 17:25:45 +00:00
setDepart((Condition)null);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__FIN:
2021-11-30 17:25:45 +00:00
setFin((Condition)null);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__PERSONNES:
getPersonnes().clear();
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DESCRIPTIONS:
getDescriptions().clear();
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__OBJETS:
getObjets().clear();
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__CONNAISSANCES:
getConnaissances().clear();
return;
2021-11-30 17:25:45 +00:00
}
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.LIEU__NOM:
2021-11-30 17:25:45 +00:00
return NOM_EDEFAULT == null ? nom != null : !NOM_EDEFAULT.equals(nom);
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DEPOSABLE:
2021-11-30 17:25:45 +00:00
return deposable != null;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DEPART:
2021-11-30 17:25:45 +00:00
return depart != null;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__FIN:
2021-11-30 17:25:45 +00:00
return fin != null;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__PERSONNES:
return personnes != null && !personnes.isEmpty();
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__DESCRIPTIONS:
return descriptions != null && !descriptions.isEmpty();
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__OBJETS:
return objets != null && !objets.isEmpty();
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU__CONNAISSANCES:
return connaissances != null && !connaissances.isEmpty();
2021-11-30 17:25:45 +00:00
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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);
2021-11-30 17:25:45 +00:00
result.append(", objets: ");
result.append(objets);
result.append(", connaissances: ");
result.append(connaissances);
2021-11-30 17:25:45 +00:00
result.append(')');
return result.toString();
}
} //LieuImpl