forked from jhauberg/ComponentKit-Example-RockPaperScissors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Behavior.cs
24 lines (20 loc) · 743 Bytes
/
Behavior.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using ComponentKit.Model;
namespace ComponentKit.Examples.RockPaperScissors {
internal abstract class Behavior : DependencyComponent {
const int DefaultMinInfluence = 1;
const int DefaultMaxInfluence = 5;
public int Influence {
get;
set;
}
public Behavior() {
/// > Think of influence as a rating for how much effect a behavior has on a players' final decision.
Influence = Roll.Next(
DefaultMinInfluence,
DefaultMaxInfluence + 1);
}
public abstract Decision Decide(IEntityRecord opponent);
public abstract Decision React(IEntityRecord opponent, Decision decision);
}
}