-
Notifications
You must be signed in to change notification settings - Fork 0
/
Entity.fs
32 lines (21 loc) · 811 Bytes
/
Entity.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
namespace Brains
open System
open Microsoft.Xna.Framework
type Alignment =
| Good
| Evil
type Entity(physical : Physical, gear : Gear, stats : Stats, alignment : Alignment) =
member this.Render(context) =
physical.Render(context)
member this.Update(gameTime) =
physical.Update(gameTime)
member this.Physical
with get() = physical
member this.Stats
with get() = stats
member this.Attack(entity : Entity) =
()
member this.Distance(entity : Entity) =
Vector2.Distance(physical.Position, entity.Physical.Position)
member this.CompareDistance (f : float32 -> float32 -> bool) (entity : Entity) x =
fun () -> f (this.Distance(entity)) x