projet-genie-logiciel-systeme/workspace/fr.n7.game/src-gen/fr/n7/game/impl/InteractionImpl.java

379 lines
9.8 KiB
Java
Raw Normal View History

2021-11-30 17:25:45 +00:00
/**
* generated by Xtext 2.23.0
*/
2021-12-03 07:37:31 +00:00
package fr.n7.game.impl;
import fr.n7.game.Action;
import fr.n7.game.Condition;
import fr.n7.game.GamePackage;
import fr.n7.game.Interaction;
2021-11-30 17:25:45 +00:00
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>Interaction</b></em>'.
2021-11-30 17:25:45 +00:00
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
2021-12-03 07:37:31 +00:00
* <li>{@link fr.n7.game.impl.InteractionImpl#getVisible <em>Visible</em>}</li>
* <li>{@link fr.n7.game.impl.InteractionImpl#getConnaissances <em>Connaissances</em>}</li>
* <li>{@link fr.n7.game.impl.InteractionImpl#getObjetsRecus <em>Objets Recus</em>}</li>
* <li>{@link fr.n7.game.impl.InteractionImpl#getObjetsConso <em>Objets Conso</em>}</li>
* <li>{@link fr.n7.game.impl.InteractionImpl#getActions <em>Actions</em>}</li>
2021-11-30 17:25:45 +00:00
* </ul>
*
* @generated
*/
public class InteractionImpl extends MinimalEObjectImpl.Container implements Interaction
2021-11-30 17:25:45 +00:00
{
/**
* The cached value of the '{@link #getVisible() <em>Visible</em>}' containment reference.
2021-11-30 17:25:45 +00:00
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVisible()
2021-11-30 17:25:45 +00:00
* @generated
* @ordered
*/
protected Condition visible;
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 #getObjetsRecus() <em>Objets Recus</em>}' attribute list.
2021-11-30 17:25:45 +00:00
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObjetsRecus()
2021-11-30 17:25:45 +00:00
* @generated
* @ordered
*/
protected EList<String> objetsRecus;
2021-11-30 17:25:45 +00:00
/**
* The cached value of the '{@link #getObjetsConso() <em>Objets Conso</em>}' attribute list.
2021-11-30 17:25:45 +00:00
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObjetsConso()
2021-11-30 17:25:45 +00:00
* @generated
* @ordered
*/
protected EList<String> objetsConso;
/**
* The cached value of the '{@link #getActions() <em>Actions</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getActions()
* @generated
* @ordered
*/
protected EList<Action> actions;
2021-11-30 17:25:45 +00:00
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected InteractionImpl()
2021-11-30 17:25:45 +00:00
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return GamePackage.Literals.INTERACTION;
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Condition getVisible()
2021-11-30 17:25:45 +00:00
{
return visible;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetVisible(Condition newVisible, NotificationChain msgs)
{
Condition oldVisible = visible;
visible = newVisible;
if (eNotificationRequired())
2021-11-30 17:25:45 +00:00
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GamePackage.INTERACTION__VISIBLE, oldVisible, newVisible);
if (msgs == null) msgs = notification; else msgs.add(notification);
2021-11-30 17:25:45 +00:00
}
return msgs;
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setVisible(Condition newVisible)
2021-11-30 17:25:45 +00:00
{
if (newVisible != visible)
2021-11-30 17:25:45 +00:00
{
NotificationChain msgs = null;
if (visible != null)
msgs = ((InternalEObject)visible).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GamePackage.INTERACTION__VISIBLE, null, msgs);
if (newVisible != null)
msgs = ((InternalEObject)newVisible).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GamePackage.INTERACTION__VISIBLE, null, msgs);
msgs = basicSetVisible(newVisible, msgs);
if (msgs != null) msgs.dispatch();
2021-11-30 17:25:45 +00:00
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.INTERACTION__VISIBLE, newVisible, newVisible));
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<String> getConnaissances()
2021-11-30 17:25:45 +00:00
{
if (connaissances == null)
2021-11-30 17:25:45 +00:00
{
connaissances = new EDataTypeEList<String>(String.class, this, GamePackage.INTERACTION__CONNAISSANCES);
2021-11-30 17:25:45 +00:00
}
return connaissances;
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<String> getObjetsRecus()
2021-11-30 17:25:45 +00:00
{
if (objetsRecus == null)
{
objetsRecus = new EDataTypeEList<String>(String.class, this, GamePackage.INTERACTION__OBJETS_RECUS);
}
return objetsRecus;
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<String> getObjetsConso()
2021-11-30 17:25:45 +00:00
{
if (objetsConso == null)
2021-11-30 17:25:45 +00:00
{
objetsConso = new EDataTypeEList<String>(String.class, this, GamePackage.INTERACTION__OBJETS_CONSO);
2021-11-30 17:25:45 +00:00
}
return objetsConso;
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Action> getActions()
2021-11-30 17:25:45 +00:00
{
if (actions == null)
2021-11-30 17:25:45 +00:00
{
actions = new EObjectContainmentEList<Action>(Action.class, this, GamePackage.INTERACTION__ACTIONS);
2021-11-30 17:25:45 +00:00
}
return actions;
2021-11-30 17:25:45 +00:00
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case GamePackage.INTERACTION__VISIBLE:
2021-11-30 17:25:45 +00:00
return basicSetVisible(null, msgs);
case GamePackage.INTERACTION__ACTIONS:
return ((InternalEList<?>)getActions()).basicRemove(otherEnd, msgs);
2021-11-30 17:25:45 +00:00
}
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.INTERACTION__VISIBLE:
2021-11-30 17:25:45 +00:00
return getVisible();
case GamePackage.INTERACTION__CONNAISSANCES:
return getConnaissances();
case GamePackage.INTERACTION__OBJETS_RECUS:
return getObjetsRecus();
case GamePackage.INTERACTION__OBJETS_CONSO:
return getObjetsConso();
case GamePackage.INTERACTION__ACTIONS:
return getActions();
2021-11-30 17:25:45 +00:00
}
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.INTERACTION__VISIBLE:
setVisible((Condition)newValue);
2021-11-30 17:25:45 +00:00
return;
case GamePackage.INTERACTION__CONNAISSANCES:
2021-11-30 17:25:45 +00:00
getConnaissances().clear();
getConnaissances().addAll((Collection<? extends String>)newValue);
return;
case GamePackage.INTERACTION__OBJETS_RECUS:
getObjetsRecus().clear();
getObjetsRecus().addAll((Collection<? extends String>)newValue);
2021-11-30 17:25:45 +00:00
return;
case GamePackage.INTERACTION__OBJETS_CONSO:
getObjetsConso().clear();
getObjetsConso().addAll((Collection<? extends String>)newValue);
return;
case GamePackage.INTERACTION__ACTIONS:
getActions().clear();
getActions().addAll((Collection<? extends Action>)newValue);
2021-11-30 17:25:45 +00:00
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case GamePackage.INTERACTION__VISIBLE:
setVisible((Condition)null);
2021-11-30 17:25:45 +00:00
return;
case GamePackage.INTERACTION__CONNAISSANCES:
2021-11-30 17:25:45 +00:00
getConnaissances().clear();
return;
case GamePackage.INTERACTION__OBJETS_RECUS:
getObjetsRecus().clear();
2021-11-30 17:25:45 +00:00
return;
case GamePackage.INTERACTION__OBJETS_CONSO:
getObjetsConso().clear();
return;
case GamePackage.INTERACTION__ACTIONS:
getActions().clear();
2021-11-30 17:25:45 +00:00
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case GamePackage.INTERACTION__VISIBLE:
2021-11-30 17:25:45 +00:00
return visible != null;
case GamePackage.INTERACTION__CONNAISSANCES:
return connaissances != null && !connaissances.isEmpty();
case GamePackage.INTERACTION__OBJETS_RECUS:
return objetsRecus != null && !objetsRecus.isEmpty();
case GamePackage.INTERACTION__OBJETS_CONSO:
return objetsConso != null && !objetsConso.isEmpty();
case GamePackage.INTERACTION__ACTIONS:
return actions != null && !actions.isEmpty();
2021-11-30 17:25:45 +00:00
}
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);
2021-11-30 17:25:45 +00:00
result.append(')');
return result.toString();
}
} //InteractionImpl