Show / Hide Table of Contents

Class GameActionManager

Handles applying all the various things that might adjust or prevent actions, and outputs display of them.

Inheritance
System.Object
GameActionManager
Namespace: Eco.Gameplay.GameActions
Assembly: Eco.Gameplay.dll
Syntax
public static class GameActionManager : Object
Remarks

Laws, contracts, and auth all should work exclusively through this interface.

Fields

GameActionLockers

Saves locks for combination of game action type and action subject (defined by ISyncedAction). It means that it will prevent running at same time same action with same subject, like two action of pick up same world object.

Declaration
public static ConcurrentDictionary<object, GameActionPack> GameActionLockers
Field Value
Type Description
System.Collections.Concurrent.ConcurrentDictionary<System.Object, GameActionPack>
Remarks

It needs to be converted from tuple to GameActionLocker since tuple is value type, and locks works in base of reference (i.e. (object, type) would never prevent nothing, since each time when it's used it will just create new reference)

GlobalDebugDisplay

Declaration
public static HashSet<User> GlobalDebugDisplay
Field Value
Type Description
System.Collections.Generic.HashSet<User>

UserOnlyDebugDisplay

Declaration
public static HashSet<User> UserOnlyDebugDisplay
Field Value
Type Description
System.Collections.Generic.HashSet<User>

Methods

CollectDebug(GameAction)

Declaration
public static bool CollectDebug(GameAction action)
Parameters
Type Name Description
GameAction action
Returns
Type Description
System.Boolean

DebugShowIfNeeded(User, GameActionPack, Result)

Declaration
public static void DebugShowIfNeeded(User user, GameActionPack pack, Result result)
Parameters
Type Name Description
User user
GameActionPack pack
Result result

DebugShowIfNeeded(User, Func<String>, Result)

Declaration
public static void DebugShowIfNeeded(User user, Func<string> desc, Result result)
Parameters
Type Name Description
User user
System.Func<System.String> desc
Result result

TryPerform(GameAction, User)

Declaration
public static Result TryPerform(this GameAction action, User userToNotify)
Parameters
Type Name Description
GameAction action
User userToNotify
Returns
Type Description
Result

TryPerform(GameActionPack, User)

Declaration
public static Result TryPerform(this GameActionPack pack, User userToNotify)
Parameters
Type Name Description
GameActionPack pack
User userToNotify
Returns
Type Description
Result

TryPerformActions(User, GameActionPack)

Passes the actions of specified pack through Laws and Auth Manager, and retrieves a failed/successful result.

Declaration
public static Result TryPerformActions(User userToNotify, GameActionPack pack)
Parameters
Type Name Description
User userToNotify
GameActionPack pack
Returns
Type Description
Result
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾