Show More
Commit Description:
Update TODOs.
Commit Description:
Update TODOs.
References:
File last commit:
Show/Diff file:
Action:
isometric-park-fna/Engines/EventEngine.cs
39 lines | 728 B | text/x-csharp | CSharpLexer
39 lines | 728 B | text/x-csharp | CSharpLexer
r408 | using System; | |||
using Encompass; | ||||
using isometricparkfna.Messages; | ||||
namespace isometricparkfna.Engines | ||||
{ | ||||
[Receives(typeof(TickMessage))] | ||||
[Sends(typeof(SpawnDialogMessage))] | ||||
class EventEngine : Engine | ||||
{ | ||||
Random Random; | ||||
public EventEngine() | ||||
{ | ||||
this.Random = new Random(); | ||||
} | ||||
public override void Update(double dt) | ||||
{ | ||||
foreach (var tick in ReadMessages<TickMessage>()) | ||||
{ | ||||
if (this.Random.Next(0, 10) == 1) | ||||
{ | ||||
Logging.Debug("Spawning Once dialog."); | ||||
SendMessage(new SpawnDialogMessage { Path = "Once" }); | ||||
} | ||||
} | ||||
} | ||||
} | ||||
} | ||||