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

392 lines
10 KiB
Java
Raw Normal View History

2021-11-30 17:25:45 +00:00
/**
* generated by Xtext 2.23.0
*/
2021-12-03 07:37:31 +00:00
package fr.n7.game.impl;
import fr.n7.game.Condition;
import fr.n7.game.GamePackage;
import fr.n7.game.Interaction;
import fr.n7.game.Personne;
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>Personne</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
2021-12-03 07:37:31 +00:00
* <li>{@link fr.n7.game.impl.PersonneImpl#getNom <em>Nom</em>}</li>
* <li>{@link fr.n7.game.impl.PersonneImpl#getVisible <em>Visible</em>}</li>
* <li>{@link fr.n7.game.impl.PersonneImpl#getObligatoire <em>Obligatoire</em>}</li>
* <li>{@link fr.n7.game.impl.PersonneImpl#getInteractions <em>Interactions</em>}</li>
2021-11-30 17:25:45 +00:00
* </ul>
*
* @generated
*/
public class PersonneImpl extends MinimalEObjectImpl.Container implements Personne
{
/**
* 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;
2021-11-30 17:25:45 +00:00
/**
* The cached value of the '{@link #getVisible() <em>Visible</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVisible()
* @generated
* @ordered
*/
protected Condition visible;
/**
* The cached value of the '{@link #getObligatoire() <em>Obligatoire</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObligatoire()
* @generated
* @ordered
*/
protected Condition obligatoire;
/**
* The cached value of the '{@link #getInteractions() <em>Interactions</em>}' containment reference list.
2021-11-30 17:25:45 +00:00
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInteractions()
2021-11-30 17:25:45 +00:00
* @generated
* @ordered
*/
protected EList<Interaction> interactions;
2021-11-30 17:25:45 +00:00
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PersonneImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return GamePackage.Literals.PERSONNE;
}
/**
* <!-- 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())
eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.PERSONNE__NOM, oldNom, nom));
}
2021-11-30 17:25:45 +00:00
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Condition getVisible()
{
return visible;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetVisible(Condition newVisible, NotificationChain msgs)
{
Condition oldVisible = visible;
visible = newVisible;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GamePackage.PERSONNE__VISIBLE, oldVisible, newVisible);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setVisible(Condition newVisible)
{
if (newVisible != visible)
{
NotificationChain msgs = null;
if (visible != null)
msgs = ((InternalEObject)visible).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GamePackage.PERSONNE__VISIBLE, null, msgs);
if (newVisible != null)
msgs = ((InternalEObject)newVisible).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GamePackage.PERSONNE__VISIBLE, null, msgs);
msgs = basicSetVisible(newVisible, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.PERSONNE__VISIBLE, newVisible, newVisible));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Condition getObligatoire()
{
return obligatoire;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetObligatoire(Condition newObligatoire, NotificationChain msgs)
{
Condition oldObligatoire = obligatoire;
obligatoire = newObligatoire;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GamePackage.PERSONNE__OBLIGATOIRE, oldObligatoire, newObligatoire);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setObligatoire(Condition newObligatoire)
{
if (newObligatoire != obligatoire)
{
NotificationChain msgs = null;
if (obligatoire != null)
msgs = ((InternalEObject)obligatoire).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GamePackage.PERSONNE__OBLIGATOIRE, null, msgs);
if (newObligatoire != null)
msgs = ((InternalEObject)newObligatoire).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GamePackage.PERSONNE__OBLIGATOIRE, null, msgs);
msgs = basicSetObligatoire(newObligatoire, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.PERSONNE__OBLIGATOIRE, newObligatoire, newObligatoire));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Interaction> getInteractions()
2021-11-30 17:25:45 +00:00
{
if (interactions == null)
2021-11-30 17:25:45 +00:00
{
interactions = new EObjectContainmentEList<Interaction>(Interaction.class, this, GamePackage.PERSONNE__INTERACTIONS);
2021-11-30 17:25:45 +00:00
}
return interactions;
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)
{
case GamePackage.PERSONNE__VISIBLE:
return basicSetVisible(null, msgs);
case GamePackage.PERSONNE__OBLIGATOIRE:
return basicSetObligatoire(null, msgs);
case GamePackage.PERSONNE__INTERACTIONS:
return ((InternalEList<?>)getInteractions()).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)
{
case GamePackage.PERSONNE__NOM:
return getNom();
2021-11-30 17:25:45 +00:00
case GamePackage.PERSONNE__VISIBLE:
return getVisible();
case GamePackage.PERSONNE__OBLIGATOIRE:
return getObligatoire();
case GamePackage.PERSONNE__INTERACTIONS:
return getInteractions();
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)
{
case GamePackage.PERSONNE__NOM:
setNom((String)newValue);
return;
2021-11-30 17:25:45 +00:00
case GamePackage.PERSONNE__VISIBLE:
setVisible((Condition)newValue);
return;
case GamePackage.PERSONNE__OBLIGATOIRE:
setObligatoire((Condition)newValue);
return;
case GamePackage.PERSONNE__INTERACTIONS:
getInteractions().clear();
getInteractions().addAll((Collection<? extends Interaction>)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)
{
case GamePackage.PERSONNE__NOM:
setNom(NOM_EDEFAULT);
return;
2021-11-30 17:25:45 +00:00
case GamePackage.PERSONNE__VISIBLE:
setVisible((Condition)null);
return;
case GamePackage.PERSONNE__OBLIGATOIRE:
setObligatoire((Condition)null);
return;
case GamePackage.PERSONNE__INTERACTIONS:
getInteractions().clear();
2021-11-30 17:25:45 +00:00
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case GamePackage.PERSONNE__NOM:
return NOM_EDEFAULT == null ? nom != null : !NOM_EDEFAULT.equals(nom);
2021-11-30 17:25:45 +00:00
case GamePackage.PERSONNE__VISIBLE:
return visible != null;
case GamePackage.PERSONNE__OBLIGATOIRE:
return obligatoire != null;
case GamePackage.PERSONNE__INTERACTIONS:
return interactions != null && !interactions.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(')');
return result.toString();
}
2021-11-30 17:25:45 +00:00
} //PersonneImpl