projet-genie-logiciel-systeme/workspace/fr.n7.game/src-gen/fr/n7/game/impl/TerritoireImpl.java
2021-12-03 08:37:31 +01:00

210 lines
4.7 KiB
Java

/**
* generated by Xtext 2.23.0
*/
package fr.n7.game.impl;
import fr.n7.game.Chemin;
import fr.n7.game.GamePackage;
import fr.n7.game.Lieu;
import fr.n7.game.Territoire;
import java.util.Collection;
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.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>Territoire</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link fr.n7.game.impl.TerritoireImpl#getLieux <em>Lieux</em>}</li>
* <li>{@link fr.n7.game.impl.TerritoireImpl#getChemins <em>Chemins</em>}</li>
* </ul>
*
* @generated
*/
public class TerritoireImpl extends MinimalEObjectImpl.Container implements Territoire
{
/**
* The cached value of the '{@link #getLieux() <em>Lieux</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLieux()
* @generated
* @ordered
*/
protected EList<Lieu> lieux;
/**
* The cached value of the '{@link #getChemins() <em>Chemins</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getChemins()
* @generated
* @ordered
*/
protected EList<Chemin> chemins;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TerritoireImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return GamePackage.Literals.TERRITOIRE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Lieu> getLieux()
{
if (lieux == null)
{
lieux = new EObjectContainmentEList<Lieu>(Lieu.class, this, GamePackage.TERRITOIRE__LIEUX);
}
return lieux;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Chemin> getChemins()
{
if (chemins == null)
{
chemins = new EObjectContainmentEList<Chemin>(Chemin.class, this, GamePackage.TERRITOIRE__CHEMINS);
}
return chemins;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case GamePackage.TERRITOIRE__LIEUX:
return ((InternalEList<?>)getLieux()).basicRemove(otherEnd, msgs);
case GamePackage.TERRITOIRE__CHEMINS:
return ((InternalEList<?>)getChemins()).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)
{
case GamePackage.TERRITOIRE__LIEUX:
return getLieux();
case GamePackage.TERRITOIRE__CHEMINS:
return getChemins();
}
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.TERRITOIRE__LIEUX:
getLieux().clear();
getLieux().addAll((Collection<? extends Lieu>)newValue);
return;
case GamePackage.TERRITOIRE__CHEMINS:
getChemins().clear();
getChemins().addAll((Collection<? extends Chemin>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case GamePackage.TERRITOIRE__LIEUX:
getLieux().clear();
return;
case GamePackage.TERRITOIRE__CHEMINS:
getChemins().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case GamePackage.TERRITOIRE__LIEUX:
return lieux != null && !lieux.isEmpty();
case GamePackage.TERRITOIRE__CHEMINS:
return chemins != null && !chemins.isEmpty();
}
return super.eIsSet(featureID);
}
} //TerritoireImpl