/**
* 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;
/**
*
* An implementation of the model object 'Territoire'.
*
*
* The following features are implemented:
*
*
* - {@link fr.n7.game.impl.TerritoireImpl#getLieux Lieux}
* - {@link fr.n7.game.impl.TerritoireImpl#getChemins Chemins}
*
*
* @generated
*/
public class TerritoireImpl extends MinimalEObjectImpl.Container implements Territoire
{
/**
* The cached value of the '{@link #getLieux() Lieux}' containment reference list.
*
*
* @see #getLieux()
* @generated
* @ordered
*/
protected EList lieux;
/**
* The cached value of the '{@link #getChemins() Chemins}' containment reference list.
*
*
* @see #getChemins()
* @generated
* @ordered
*/
protected EList chemins;
/**
*
*
* @generated
*/
protected TerritoireImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return GamePackage.Literals.TERRITOIRE;
}
/**
*
*
* @generated
*/
@Override
public EList getLieux()
{
if (lieux == null)
{
lieux = new EObjectContainmentEList(Lieu.class, this, GamePackage.TERRITOIRE__LIEUX);
}
return lieux;
}
/**
*
*
* @generated
*/
@Override
public EList getChemins()
{
if (chemins == null)
{
chemins = new EObjectContainmentEList(Chemin.class, this, GamePackage.TERRITOIRE__CHEMINS);
}
return chemins;
}
/**
*
*
* @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);
}
/**
*
*
* @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);
}
/**
*
*
* @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);
}
/**
*
*
* @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);
}
/**
*
*
* @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