Class FakeUrge
A fake urge used for testing.
Inheritance
FakeUrge
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Tests
Assembly: BotBrain.Core.Tests.dll
Syntax
public class FakeUrge : UrgeBase<bool, FakeBot<FakeBotAction>, FakeBotAction>, IUrge<bool, FakeBot<FakeBotAction>, FakeBotAction>, IUrge, IEquatable<IUrge?>
Constructors
View SourceFakeUrge(string?, ILogger<FakeUrge>?)
A fake urge used for testing.
Declaration
public FakeUrge(string? name = null, ILogger<FakeUrge>? logger = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | |
ILogger<FakeUrge> | logger | The logger to use. |
Properties
View SourceActionName
Gets or sets the action name to recommend.
Declaration
[DataMember]
public string? ActionName { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
View SourceRun(bool, FakeBot<FakeBotAction>)
Chooses an action and urgency of that action for the given bot and state.
Declaration
public override Task<IEnumerable<IRecommendedAction<FakeBotAction>>> Run(bool state, FakeBot<FakeBotAction> bot)
Parameters
Type | Name | Description |
---|---|---|
bool | state | The game state. |
FakeBot<FakeBotAction> | bot | The bot to control. |
Returns
Type | Description |
---|---|
Task<IEnumerable<IRecommendedAction<FakeBotAction>>> | An enumerable of weighted bot actions. |
Overrides
View SourceRunImpl(bool, FakeBot<FakeBotAction>)
Runs the urge given the existing game state, returning one or more weighted bot actions.
Declaration
protected virtual IEnumerable<IRecommendedAction<FakeBotAction>> RunImpl(bool state, FakeBot<FakeBotAction> bot)
Parameters
Type | Name | Description |
---|---|---|
bool | state | The game state. |
FakeBot<FakeBotAction> | bot | The bot to control. |
Returns
Type | Description |
---|---|
IEnumerable<IRecommendedAction<FakeBotAction>> | An enumeration of weighted bot actions. |