Created
December 28, 2011 20:05
-
-
Save samneirinck/1529470 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected virtual void OnStartGame() | |
{ | |
Console.WriteLine("OnStartGame"); | |
Trace.Listeners.Add(new TextWriterTraceListener(@"c:\temp\calls.log")); | |
if (GameStarted != null) | |
{ | |
// Crazy and terrible workaround | |
// Somehow doing stuff at this stage, like spawning entities, will happen to soon, and not show up ingame at all | |
// If we sleep a bit it should all work fine | |
// PLEASE FIX THIS SOME TIME | |
var t = new Thread(() => | |
{ | |
Thread.Sleep(1); | |
Dispatcher.BeginInvoke(() => GameStarted(this, new EventArgs())); | |
}); | |
t.Start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment