Show / Hide Table of Contents

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
Namespace: Eco.Gameplay.GameActions
Assembly: Eco.Gameplay.dll
Syntax
public sealed class GameActionPack : Object, IDisposable

Constructors

GameActionPack()

Declaration
public GameActionPack()

GameActionPack(GameAction)

Declaration
public GameActionPack(GameAction gameAction)
Parameters
Type Name Description
GameAction gameAction

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
Type Name Description
GameAction gameAction
System.Func<LocString> postEffect

GameActionPack(InventoryChangeSet)

Declaration
public GameActionPack(InventoryChangeSet changeSet)
Parameters
Type Name Description
InventoryChangeSet changeSet

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
Type Description
Result

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
public object Locker
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
Type Description
PackFlags

Methods

AddChangeSet(IGameActionPackChangeSet)

Changesets need to be cleaned up afterwards.

Declaration
public void AddChangeSet(IGameActionPackChangeSet changeSet)
Parameters
Type Name Description
IGameActionPackChangeSet changeSet

AddGameAction(GameAction)

Declaration
public GameActionPack AddGameAction(GameAction action)
Parameters
Type Name Description
GameAction action
Returns
Type Description
GameActionPack

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
Type Description
GameActionPack

This action pack.

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
Type Description
GameActionPack

This action pack.

DebugDescribe(User)

Declaration
public string DebugDescribe(User user)
Parameters
Type Name Description
User user
Returns
Type Description
System.String

Dispose()

Declaration
public void Dispose()

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
Type Description
AccountChangeSet

GetChangeSetOrDefault<T>()

Declaration
public T GetChangeSetOrDefault<T>()
    where T : IGameActionPackChangeSet
Returns
Type Description
T
Type Parameters
Name Description
T

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 Description
T
Type Parameters
Name Description
T

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
Name Description
T

Implements

System.IDisposable

Extension Methods

AtomicActions.DropRubble(GameActionPack, Player, BlockItem, Inventory, Vector3, Single)
AtomicActions.PickupRubbles(GameActionPack, Player, Inventory, IEnumerable<RubbleObject>, Type, INetObject, Boolean)
AtomicActions.ExplodePositions(GameActionPack, Player, IEnumerable<Vector3i>, WorldObject, Action<IEnumerable<Vector3i>>, Single)
AtomicActions.BurnCaloriesAndCheckExhaustion(GameActionPack, User, Boolean, Single, Boolean)
AtomicActions.BurnFuel(GameActionPack, FuelSupplyComponent, Single)
AtomicActions.RemoveFromInventory(GameActionPack, User, Inventory, Type)
AtomicActions.AddToInventory(GameActionPack, Inventory, Item, Int32, User)
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)
AtomicActions.PlaceBlock(GameActionPack, MultiblockActionContext, Type, Type, Boolean, Inventory, Type)
AtomicActions.DeleteBlock(GameActionPack, MultiblockActionContext, Inventory, Item, Boolean, Boolean, Boolean)
AtomicActions.DeleteBlock(GameActionPack, MultiblockActionContext, Func<WrappedWorldPosition3i, Boolean>, Inventory, Item, Boolean, Boolean)
AtomicActions.ChangeBlock(GameActionPack, MultiblockActionContext, Type)
AtomicActions.UseTool(GameActionPack, MultiblockActionContext, Single)
AtomicActions.PaintBlock(GameActionPack, MultiblockActionContext, ByteColor, Byte, List<ItemStack>)
AtomicActions.ClearBlockPaint(GameActionPack, MultiblockActionContext)
AtomicActions.ClearObjectPaint(GameActionPack, MultiblockActionContext, WorldObject, Int32)
AtomicActions.PaintObject(GameActionPack, MultiblockActionContext, WorldObject, ByteColor, Byte, Int32, List<ItemStack>)
AtomicActions.DestroyPlant(GameActionPack, MultiblockActionContext, DeathType, Inventory, Func<PlantSpecies, Boolean>)
AtomicActions.HarvestPlant(GameActionPack, MultiblockActionContext, Inventory, Boolean)
GameActionManager.TryPerform(GameActionPack, User)
GameActionPackExtension.GetOrCreateInventoryChangeSet(GameActionPack, Inventory, User)
GameActionPackExtension.GetOrCreateInventoryChangeSet(GameActionPack, IEnumerable<Inventory>, User)
TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
PlantGameActions.AddSeedAction(GameActionPack, PlantSpecies, Vector3i, User, Item)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
TypeTooltipExtensions.UILinkGeneric(Object)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾