2021-11-30 17:25:45 +00:00
|
|
|
/**
|
|
|
|
* generated by Xtext 2.23.0
|
|
|
|
*/
|
|
|
|
package xtext.game.impl;
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
|
|
|
import org.eclipse.emf.common.notify.Notification;
|
|
|
|
|
|
|
|
import org.eclipse.emf.common.util.EList;
|
|
|
|
|
|
|
|
import org.eclipse.emf.ecore.EClass;
|
|
|
|
|
|
|
|
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
|
|
|
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
|
|
|
|
|
|
|
import org.eclipse.emf.ecore.util.EDataTypeEList;
|
|
|
|
|
|
|
|
import xtext.game.Explorateur;
|
|
|
|
import xtext.game.GamePackage;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* An implementation of the model object '<em><b>Explorateur</b></em>'.
|
|
|
|
* <!-- end-user-doc -->
|
|
|
|
* <p>
|
|
|
|
* The following features are implemented:
|
|
|
|
* </p>
|
|
|
|
* <ul>
|
2021-12-03 07:36:23 +00:00
|
|
|
* <li>{@link xtext.game.impl.ExplorateurImpl#getTailleInventaire <em>Taille Inventaire</em>}</li>
|
2021-11-30 17:25:45 +00:00
|
|
|
* <li>{@link xtext.game.impl.ExplorateurImpl#getConnaissances <em>Connaissances</em>}</li>
|
|
|
|
* <li>{@link xtext.game.impl.ExplorateurImpl#getObjets <em>Objets</em>}</li>
|
|
|
|
* </ul>
|
|
|
|
*
|
|
|
|
* @generated
|
|
|
|
*/
|
|
|
|
public class ExplorateurImpl extends MinimalEObjectImpl.Container implements Explorateur
|
|
|
|
{
|
|
|
|
/**
|
2021-12-03 07:36:23 +00:00
|
|
|
* The default value of the '{@link #getTailleInventaire() <em>Taille Inventaire</em>}' attribute.
|
2021-11-30 17:25:45 +00:00
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
2021-12-03 07:36:23 +00:00
|
|
|
* @see #getTailleInventaire()
|
2021-11-30 17:25:45 +00:00
|
|
|
* @generated
|
|
|
|
* @ordered
|
|
|
|
*/
|
2021-12-03 07:36:23 +00:00
|
|
|
protected static final int TAILLE_INVENTAIRE_EDEFAULT = 0;
|
2021-11-30 17:25:45 +00:00
|
|
|
|
|
|
|
/**
|
2021-12-03 07:36:23 +00:00
|
|
|
* The cached value of the '{@link #getTailleInventaire() <em>Taille Inventaire</em>}' attribute.
|
2021-11-30 17:25:45 +00:00
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
2021-12-03 07:36:23 +00:00
|
|
|
* @see #getTailleInventaire()
|
2021-11-30 17:25:45 +00:00
|
|
|
* @generated
|
|
|
|
* @ordered
|
|
|
|
*/
|
2021-12-03 07:36:23 +00:00
|
|
|
protected int tailleInventaire = TAILLE_INVENTAIRE_EDEFAULT;
|
2021-11-30 17:25:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The cached value of the '{@link #getConnaissances() <em>Connaissances</em>}' attribute list.
|
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
|
|
|
* @see #getConnaissances()
|
|
|
|
* @generated
|
|
|
|
* @ordered
|
|
|
|
*/
|
|
|
|
protected EList<String> connaissances;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The cached value of the '{@link #getObjets() <em>Objets</em>}' attribute list.
|
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
|
|
|
* @see #getObjets()
|
|
|
|
* @generated
|
|
|
|
* @ordered
|
|
|
|
*/
|
|
|
|
protected EList<String> objets;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
|
|
|
* @generated
|
|
|
|
*/
|
|
|
|
protected ExplorateurImpl()
|
|
|
|
{
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
|
|
|
* @generated
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
protected EClass eStaticClass()
|
|
|
|
{
|
|
|
|
return GamePackage.Literals.EXPLORATEUR;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
|
|
|
* @generated
|
|
|
|
*/
|
|
|
|
@Override
|
2021-12-03 07:36:23 +00:00
|
|
|
public int getTailleInventaire()
|
2021-11-30 17:25:45 +00:00
|
|
|
{
|
2021-12-03 07:36:23 +00:00
|
|
|
return tailleInventaire;
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
|
|
|
* @generated
|
|
|
|
*/
|
|
|
|
@Override
|
2021-12-03 07:36:23 +00:00
|
|
|
public void setTailleInventaire(int newTailleInventaire)
|
2021-11-30 17:25:45 +00:00
|
|
|
{
|
2021-12-03 07:36:23 +00:00
|
|
|
int oldTailleInventaire = tailleInventaire;
|
|
|
|
tailleInventaire = newTailleInventaire;
|
2021-11-30 17:25:45 +00:00
|
|
|
if (eNotificationRequired())
|
2021-12-03 07:36:23 +00:00
|
|
|
eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.EXPLORATEUR__TAILLE_INVENTAIRE, oldTailleInventaire, tailleInventaire));
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
|
|
|
* @generated
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public EList<String> getConnaissances()
|
|
|
|
{
|
|
|
|
if (connaissances == null)
|
|
|
|
{
|
|
|
|
connaissances = new EDataTypeEList<String>(String.class, this, GamePackage.EXPLORATEUR__CONNAISSANCES);
|
|
|
|
}
|
|
|
|
return connaissances;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
|
|
|
* @generated
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public EList<String> getObjets()
|
|
|
|
{
|
|
|
|
if (objets == null)
|
|
|
|
{
|
|
|
|
objets = new EDataTypeEList<String>(String.class, this, GamePackage.EXPLORATEUR__OBJETS);
|
|
|
|
}
|
|
|
|
return objets;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
|
|
|
* @generated
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
|
|
|
{
|
|
|
|
switch (featureID)
|
|
|
|
{
|
2021-12-03 07:36:23 +00:00
|
|
|
case GamePackage.EXPLORATEUR__TAILLE_INVENTAIRE:
|
|
|
|
return getTailleInventaire();
|
2021-11-30 17:25:45 +00:00
|
|
|
case GamePackage.EXPLORATEUR__CONNAISSANCES:
|
|
|
|
return getConnaissances();
|
|
|
|
case GamePackage.EXPLORATEUR__OBJETS:
|
|
|
|
return getObjets();
|
|
|
|
}
|
|
|
|
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 07:36:23 +00:00
|
|
|
case GamePackage.EXPLORATEUR__TAILLE_INVENTAIRE:
|
|
|
|
setTailleInventaire((Integer)newValue);
|
2021-11-30 17:25:45 +00:00
|
|
|
return;
|
|
|
|
case GamePackage.EXPLORATEUR__CONNAISSANCES:
|
|
|
|
getConnaissances().clear();
|
|
|
|
getConnaissances().addAll((Collection<? extends String>)newValue);
|
|
|
|
return;
|
|
|
|
case GamePackage.EXPLORATEUR__OBJETS:
|
|
|
|
getObjets().clear();
|
|
|
|
getObjets().addAll((Collection<? extends String>)newValue);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
super.eSet(featureID, newValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
|
|
|
* @generated
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public void eUnset(int featureID)
|
|
|
|
{
|
|
|
|
switch (featureID)
|
|
|
|
{
|
2021-12-03 07:36:23 +00:00
|
|
|
case GamePackage.EXPLORATEUR__TAILLE_INVENTAIRE:
|
|
|
|
setTailleInventaire(TAILLE_INVENTAIRE_EDEFAULT);
|
2021-11-30 17:25:45 +00:00
|
|
|
return;
|
|
|
|
case GamePackage.EXPLORATEUR__CONNAISSANCES:
|
|
|
|
getConnaissances().clear();
|
|
|
|
return;
|
|
|
|
case GamePackage.EXPLORATEUR__OBJETS:
|
|
|
|
getObjets().clear();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
super.eUnset(featureID);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* <!-- begin-user-doc -->
|
|
|
|
* <!-- end-user-doc -->
|
|
|
|
* @generated
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public boolean eIsSet(int featureID)
|
|
|
|
{
|
|
|
|
switch (featureID)
|
|
|
|
{
|
2021-12-03 07:36:23 +00:00
|
|
|
case GamePackage.EXPLORATEUR__TAILLE_INVENTAIRE:
|
|
|
|
return tailleInventaire != TAILLE_INVENTAIRE_EDEFAULT;
|
2021-11-30 17:25:45 +00:00
|
|
|
case GamePackage.EXPLORATEUR__CONNAISSANCES:
|
|
|
|
return connaissances != null && !connaissances.isEmpty();
|
|
|
|
case GamePackage.EXPLORATEUR__OBJETS:
|
|
|
|
return objets != null && !objets.isEmpty();
|
|
|
|
}
|
|
|
|
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());
|
2021-12-03 07:36:23 +00:00
|
|
|
result.append(" (tailleInventaire: ");
|
|
|
|
result.append(tailleInventaire);
|
2021-11-30 17:25:45 +00:00
|
|
|
result.append(", connaissances: ");
|
|
|
|
result.append(connaissances);
|
|
|
|
result.append(", objets: ");
|
|
|
|
result.append(objets);
|
|
|
|
result.append(')');
|
|
|
|
return result.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
} //ExplorateurImpl
|