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

271 lines
6.3 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.Description;
import fr.n7.game.GamePackage;
2021-11-30 17:25:45 +00:00
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Description</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.DescriptionImpl#getTexte <em>Texte</em>}</li>
* <li>{@link fr.n7.game.impl.DescriptionImpl#getCondition <em>Condition</em>}</li>
2021-11-30 17:25:45 +00:00
* </ul>
*
* @generated
*/
public class DescriptionImpl extends MinimalEObjectImpl.Container implements Description
{
/**
* The default value of the '{@link #getTexte() <em>Texte</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTexte()
* @generated
* @ordered
*/
protected static final String TEXTE_EDEFAULT = null;
/**
* The cached value of the '{@link #getTexte() <em>Texte</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTexte()
* @generated
* @ordered
*/
protected String texte = TEXTE_EDEFAULT;
/**
* The cached value of the '{@link #getCondition() <em>Condition</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCondition()
* @generated
* @ordered
*/
protected Condition condition;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DescriptionImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return GamePackage.Literals.DESCRIPTION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getTexte()
{
return texte;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setTexte(String newTexte)
{
String oldTexte = texte;
texte = newTexte;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.DESCRIPTION__TEXTE, oldTexte, texte));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Condition getCondition()
{
return condition;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetCondition(Condition newCondition, NotificationChain msgs)
{
Condition oldCondition = condition;
condition = newCondition;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GamePackage.DESCRIPTION__CONDITION, oldCondition, newCondition);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setCondition(Condition newCondition)
{
if (newCondition != condition)
{
NotificationChain msgs = null;
if (condition != null)
msgs = ((InternalEObject)condition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GamePackage.DESCRIPTION__CONDITION, null, msgs);
if (newCondition != null)
msgs = ((InternalEObject)newCondition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GamePackage.DESCRIPTION__CONDITION, null, msgs);
msgs = basicSetCondition(newCondition, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.DESCRIPTION__CONDITION, newCondition, newCondition));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case GamePackage.DESCRIPTION__CONDITION:
return basicSetCondition(null, 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.DESCRIPTION__TEXTE:
return getTexte();
case GamePackage.DESCRIPTION__CONDITION:
return getCondition();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case GamePackage.DESCRIPTION__TEXTE:
setTexte((String)newValue);
return;
case GamePackage.DESCRIPTION__CONDITION:
setCondition((Condition)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case GamePackage.DESCRIPTION__TEXTE:
setTexte(TEXTE_EDEFAULT);
return;
case GamePackage.DESCRIPTION__CONDITION:
setCondition((Condition)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case GamePackage.DESCRIPTION__TEXTE:
return TEXTE_EDEFAULT == null ? texte != null : !TEXTE_EDEFAULT.equals(texte);
case GamePackage.DESCRIPTION__CONDITION:
return condition != null;
}
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(" (texte: ");
result.append(texte);
result.append(')');
return result.toString();
}
} //DescriptionImpl