452 lines
12 KiB
Java
452 lines
12 KiB
Java
/**
|
|
* generated by Xtext 2.23.0
|
|
*/
|
|
package fr.n7.gAME.impl;
|
|
|
|
import fr.n7.gAME.Action;
|
|
import fr.n7.gAME.Condition;
|
|
import fr.n7.gAME.Description;
|
|
import fr.n7.gAME.GAMEPackage;
|
|
|
|
import java.util.Collection;
|
|
|
|
import org.eclipse.emf.common.notify.Notification;
|
|
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.ENotificationImpl;
|
|
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
|
|
|
import org.eclipse.emf.ecore.util.EDataTypeEList;
|
|
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>Action</b></em>'.
|
|
* <!-- end-user-doc -->
|
|
* <p>
|
|
* The following features are implemented:
|
|
* </p>
|
|
* <ul>
|
|
* <li>{@link fr.n7.gAME.impl.ActionImpl#getDescriptions <em>Descriptions</em>}</li>
|
|
* <li>{@link fr.n7.gAME.impl.ActionImpl#getVisible <em>Visible</em>}</li>
|
|
* <li>{@link fr.n7.gAME.impl.ActionImpl#getConnaissances <em>Connaissances</em>}</li>
|
|
* <li>{@link fr.n7.gAME.impl.ActionImpl#getObjetsRecus <em>Objets Recus</em>}</li>
|
|
* <li>{@link fr.n7.gAME.impl.ActionImpl#getObjetsConso <em>Objets Conso</em>}</li>
|
|
* <li>{@link fr.n7.gAME.impl.ActionImpl#getFinInteraction <em>Fin Interaction</em>}</li>
|
|
* </ul>
|
|
*
|
|
* @generated
|
|
*/
|
|
public class ActionImpl extends MinimalEObjectImpl.Container implements Action
|
|
{
|
|
/**
|
|
* The cached value of the '{@link #getDescriptions() <em>Descriptions</em>}' containment reference list.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getDescriptions()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected EList<Description> descriptions;
|
|
|
|
/**
|
|
* The cached value of the '{@link #getVisible() <em>Visible</em>}' containment reference.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getVisible()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected Condition visible;
|
|
|
|
/**
|
|
* 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 #getObjetsRecus() <em>Objets Recus</em>}' attribute list.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getObjetsRecus()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected EList<String> objetsRecus;
|
|
|
|
/**
|
|
* The cached value of the '{@link #getObjetsConso() <em>Objets Conso</em>}' attribute list.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getObjetsConso()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected EList<String> objetsConso;
|
|
|
|
/**
|
|
* The cached value of the '{@link #getFinInteraction() <em>Fin Interaction</em>}' containment reference.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getFinInteraction()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected Condition finInteraction;
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
protected ActionImpl()
|
|
{
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
protected EClass eStaticClass()
|
|
{
|
|
return GAMEPackage.Literals.ACTION;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EList<Description> getDescriptions()
|
|
{
|
|
if (descriptions == null)
|
|
{
|
|
descriptions = new EObjectContainmentEList<Description>(Description.class, this, GAMEPackage.ACTION__DESCRIPTIONS);
|
|
}
|
|
return descriptions;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public Condition getVisible()
|
|
{
|
|
return visible;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
public NotificationChain basicSetVisible(Condition newVisible, NotificationChain msgs)
|
|
{
|
|
Condition oldVisible = visible;
|
|
visible = newVisible;
|
|
if (eNotificationRequired())
|
|
{
|
|
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.ACTION__VISIBLE, oldVisible, newVisible);
|
|
if (msgs == null) msgs = notification; else msgs.add(notification);
|
|
}
|
|
return msgs;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public void setVisible(Condition newVisible)
|
|
{
|
|
if (newVisible != visible)
|
|
{
|
|
NotificationChain msgs = null;
|
|
if (visible != null)
|
|
msgs = ((InternalEObject)visible).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.ACTION__VISIBLE, null, msgs);
|
|
if (newVisible != null)
|
|
msgs = ((InternalEObject)newVisible).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.ACTION__VISIBLE, null, msgs);
|
|
msgs = basicSetVisible(newVisible, msgs);
|
|
if (msgs != null) msgs.dispatch();
|
|
}
|
|
else if (eNotificationRequired())
|
|
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.ACTION__VISIBLE, newVisible, newVisible));
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EList<String> getConnaissances()
|
|
{
|
|
if (connaissances == null)
|
|
{
|
|
connaissances = new EDataTypeEList<String>(String.class, this, GAMEPackage.ACTION__CONNAISSANCES);
|
|
}
|
|
return connaissances;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EList<String> getObjetsRecus()
|
|
{
|
|
if (objetsRecus == null)
|
|
{
|
|
objetsRecus = new EDataTypeEList<String>(String.class, this, GAMEPackage.ACTION__OBJETS_RECUS);
|
|
}
|
|
return objetsRecus;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EList<String> getObjetsConso()
|
|
{
|
|
if (objetsConso == null)
|
|
{
|
|
objetsConso = new EDataTypeEList<String>(String.class, this, GAMEPackage.ACTION__OBJETS_CONSO);
|
|
}
|
|
return objetsConso;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public Condition getFinInteraction()
|
|
{
|
|
return finInteraction;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
public NotificationChain basicSetFinInteraction(Condition newFinInteraction, NotificationChain msgs)
|
|
{
|
|
Condition oldFinInteraction = finInteraction;
|
|
finInteraction = newFinInteraction;
|
|
if (eNotificationRequired())
|
|
{
|
|
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.ACTION__FIN_INTERACTION, oldFinInteraction, newFinInteraction);
|
|
if (msgs == null) msgs = notification; else msgs.add(notification);
|
|
}
|
|
return msgs;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public void setFinInteraction(Condition newFinInteraction)
|
|
{
|
|
if (newFinInteraction != finInteraction)
|
|
{
|
|
NotificationChain msgs = null;
|
|
if (finInteraction != null)
|
|
msgs = ((InternalEObject)finInteraction).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.ACTION__FIN_INTERACTION, null, msgs);
|
|
if (newFinInteraction != null)
|
|
msgs = ((InternalEObject)newFinInteraction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.ACTION__FIN_INTERACTION, null, msgs);
|
|
msgs = basicSetFinInteraction(newFinInteraction, msgs);
|
|
if (msgs != null) msgs.dispatch();
|
|
}
|
|
else if (eNotificationRequired())
|
|
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.ACTION__FIN_INTERACTION, newFinInteraction, newFinInteraction));
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
|
{
|
|
switch (featureID)
|
|
{
|
|
case GAMEPackage.ACTION__DESCRIPTIONS:
|
|
return ((InternalEList<?>)getDescriptions()).basicRemove(otherEnd, msgs);
|
|
case GAMEPackage.ACTION__VISIBLE:
|
|
return basicSetVisible(null, msgs);
|
|
case GAMEPackage.ACTION__FIN_INTERACTION:
|
|
return basicSetFinInteraction(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.ACTION__DESCRIPTIONS:
|
|
return getDescriptions();
|
|
case GAMEPackage.ACTION__VISIBLE:
|
|
return getVisible();
|
|
case GAMEPackage.ACTION__CONNAISSANCES:
|
|
return getConnaissances();
|
|
case GAMEPackage.ACTION__OBJETS_RECUS:
|
|
return getObjetsRecus();
|
|
case GAMEPackage.ACTION__OBJETS_CONSO:
|
|
return getObjetsConso();
|
|
case GAMEPackage.ACTION__FIN_INTERACTION:
|
|
return getFinInteraction();
|
|
}
|
|
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.ACTION__DESCRIPTIONS:
|
|
getDescriptions().clear();
|
|
getDescriptions().addAll((Collection<? extends Description>)newValue);
|
|
return;
|
|
case GAMEPackage.ACTION__VISIBLE:
|
|
setVisible((Condition)newValue);
|
|
return;
|
|
case GAMEPackage.ACTION__CONNAISSANCES:
|
|
getConnaissances().clear();
|
|
getConnaissances().addAll((Collection<? extends String>)newValue);
|
|
return;
|
|
case GAMEPackage.ACTION__OBJETS_RECUS:
|
|
getObjetsRecus().clear();
|
|
getObjetsRecus().addAll((Collection<? extends String>)newValue);
|
|
return;
|
|
case GAMEPackage.ACTION__OBJETS_CONSO:
|
|
getObjetsConso().clear();
|
|
getObjetsConso().addAll((Collection<? extends String>)newValue);
|
|
return;
|
|
case GAMEPackage.ACTION__FIN_INTERACTION:
|
|
setFinInteraction((Condition)newValue);
|
|
return;
|
|
}
|
|
super.eSet(featureID, newValue);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public void eUnset(int featureID)
|
|
{
|
|
switch (featureID)
|
|
{
|
|
case GAMEPackage.ACTION__DESCRIPTIONS:
|
|
getDescriptions().clear();
|
|
return;
|
|
case GAMEPackage.ACTION__VISIBLE:
|
|
setVisible((Condition)null);
|
|
return;
|
|
case GAMEPackage.ACTION__CONNAISSANCES:
|
|
getConnaissances().clear();
|
|
return;
|
|
case GAMEPackage.ACTION__OBJETS_RECUS:
|
|
getObjetsRecus().clear();
|
|
return;
|
|
case GAMEPackage.ACTION__OBJETS_CONSO:
|
|
getObjetsConso().clear();
|
|
return;
|
|
case GAMEPackage.ACTION__FIN_INTERACTION:
|
|
setFinInteraction((Condition)null);
|
|
return;
|
|
}
|
|
super.eUnset(featureID);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public boolean eIsSet(int featureID)
|
|
{
|
|
switch (featureID)
|
|
{
|
|
case GAMEPackage.ACTION__DESCRIPTIONS:
|
|
return descriptions != null && !descriptions.isEmpty();
|
|
case GAMEPackage.ACTION__VISIBLE:
|
|
return visible != null;
|
|
case GAMEPackage.ACTION__CONNAISSANCES:
|
|
return connaissances != null && !connaissances.isEmpty();
|
|
case GAMEPackage.ACTION__OBJETS_RECUS:
|
|
return objetsRecus != null && !objetsRecus.isEmpty();
|
|
case GAMEPackage.ACTION__OBJETS_CONSO:
|
|
return objetsConso != null && !objetsConso.isEmpty();
|
|
case GAMEPackage.ACTION__FIN_INTERACTION:
|
|
return finInteraction != 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(" (connaissances: ");
|
|
result.append(connaissances);
|
|
result.append(", objetsRecus: ");
|
|
result.append(objetsRecus);
|
|
result.append(", objetsConso: ");
|
|
result.append(objetsConso);
|
|
result.append(')');
|
|
return result.toString();
|
|
}
|
|
|
|
} //ActionImpl
|