/**
* generated by Xtext 2.23.0
*/
package fr.n7.game.impl;
import fr.n7.game.Condition;
import fr.n7.game.ConditionEt;
import fr.n7.game.GamePackage;
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 'Condition'.
*
*
* The following features are implemented:
*
*
* - {@link fr.n7.game.impl.ConditionImpl#getCondition Condition}
*
*
* @generated
*/
public class ConditionImpl extends MinimalEObjectImpl.Container implements Condition
{
/**
* The cached value of the '{@link #getCondition() Condition}' containment reference list.
*
*
* @see #getCondition()
* @generated
* @ordered
*/
protected EList condition;
/**
*
*
* @generated
*/
protected ConditionImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return GamePackage.Literals.CONDITION;
}
/**
*
*
* @generated
*/
@Override
public EList getCondition()
{
if (condition == null)
{
condition = new EObjectContainmentEList(ConditionEt.class, this, GamePackage.CONDITION__CONDITION);
}
return condition;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case GamePackage.CONDITION__CONDITION:
return ((InternalEList>)getCondition()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case GamePackage.CONDITION__CONDITION:
return getCondition();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case GamePackage.CONDITION__CONDITION:
getCondition().clear();
getCondition().addAll((Collection extends ConditionEt>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case GamePackage.CONDITION__CONDITION:
getCondition().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case GamePackage.CONDITION__CONDITION:
return condition != null && !condition.isEmpty();
}
return super.eIsSet(featureID);
}
} //ConditionImpl