Class GameActionPack
In Eco many actions can be blocked or modified by laws. This is handled with the GameActionPack, which defines an action to try to run,
and a set of 'PostEffects' that subsequently run if it succeeds, as well as objects to dispose on completion. These packs are created then
passed to the GameActionManager to perform them.
Inheritance
System.Object
GameActionPack
Implements
System.IDisposable
Assembly: Eco.Gameplay.dll
Syntax
public sealed class GameActionPack : Object, IDisposable
Constructors
GameActionPack()
Declaration
GameActionPack(GameAction)
Declaration
public GameActionPack(GameAction gameAction)
Parameters
GameActionPack(GameAction, Action)
Wrapper that lets us attach post-effects that don't need to return a status.
Declaration
public GameActionPack(GameAction gameAction, Action postEffect)
Parameters
Type |
Name |
Description |
GameAction |
gameAction |
|
System.Action |
postEffect |
|
GameActionPack(GameAction, Func<LocString>)
Declaration
public GameActionPack(GameAction gameAction, Func<LocString> postEffect)
Parameters
GameActionPack(InventoryChangeSet)
Declaration
public GameActionPack(InventoryChangeSet changeSet)
Parameters
GameActionPack(IEnumerable<Func<LocString>>)
Declaration
public GameActionPack(IEnumerable<Func<LocString>> postEffects)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Func<LocString>> |
postEffects |
|
Fields
EarlyResult
If an action fails early, this will be set, preventing further atomic actions from bothering to do anything.
Declaration
public Result EarlyResult
Field Value
Locker
Locking object of gameactionpack. Sample: When pick up same item, it will be locked, so another similar action (pick up) with same item will block each other, still allowing different things interact with this item.
Declaration
Field Value
Type |
Description |
System.Object |
|
Properties
Empty
Declaration
public bool Empty { get; }
Property Value
Type |
Description |
System.Boolean |
|
PackFlags
We can modify how the pack is performed with these flags.
Declaration
public PackFlags PackFlags { get; set; }
Property Value
Methods
AddChangeSet(IGameActionPackChangeSet)
Changesets need to be cleaned up afterwards.
Declaration
public void AddChangeSet(IGameActionPackChangeSet changeSet)
Parameters
AddGameAction(GameAction)
Declaration
public GameActionPack AddGameAction(GameAction action)
Parameters
Returns
AddPostEffect(Action)
Add a delegate that will be executed after all tests in this pack pass successfully.
Declaration
public GameActionPack AddPostEffect(Action action)
Parameters
Type |
Name |
Description |
System.Action |
action |
|
Returns
AddPostEffect(Func<LocString>)
Add a delegate that will be executed after all tests in this pack pass successfully.
Declaration
public GameActionPack AddPostEffect(Func<LocString> func)
Parameters
Type |
Name |
Description |
System.Func<LocString> |
func |
|
Returns
DebugDescribe(User)
Declaration
public string DebugDescribe(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Returns
Type |
Description |
System.String |
|
Dispose()
Declaration
GetAccountChangeSet(Boolean)
Returns a change set that tracks money transfers.
Declaration
public AccountChangeSet GetAccountChangeSet(bool create = true)
Parameters
Type |
Name |
Description |
System.Boolean |
create |
|
Returns
GetChangeSetOrDefault<T>()
Declaration
public T GetChangeSetOrDefault<T>()
where T : IGameActionPackChangeSet
Returns
Type Parameters
GetOrCreateChangeSet<T>(Func<T>)
Declaration
public T GetOrCreateChangeSet<T>(Func<T> newChangeSetFunc)
where T : IGameActionPackChangeSet
Parameters
Type |
Name |
Description |
System.Func<T> |
newChangeSetFunc |
|
Returns
Type Parameters
TryGetChangeSet<T>(out T)
Declaration
public bool TryGetChangeSet<T>(out T changeSet)
Parameters
Type |
Name |
Description |
T |
changeSet |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
Implements
System.IDisposable
Extension Methods
AtomicActions.ClaimOrUnclaimProperties(GameActionPack, Deed, User, IEnumerable<PlotPos>, IEnumerable<PlotPos>, Boolean, Boolean, Boolean, Boolean, IAlias, Nullable<LocString>, Nullable<PropertyType>, Type)
AtomicActions.ClaimProperty(GameActionPack, Deed, User, PlotPos, ClaimedOrUnclaimed, Boolean, Boolean, Boolean, Boolean, IAlias, Nullable<LocString>, PropertyType, Type)