diff --git a/DataInterfaceConsoleTest/Program.cs b/DataInterfaceConsoleTest/Program.cs index c1d2c1b..5103924 100644 --- a/DataInterfaceConsoleTest/Program.cs +++ b/DataInterfaceConsoleTest/Program.cs @@ -34,9 +34,9 @@ private static void RecordGames(DataInterface di) int oldCnt = 0; string lastRun = ""; string fen = ""; - var lastP = di.GetCurrentPlayersTurn(); - var lastTime = di.GetCurT(); - System.Media.SoundPlayer player = new System.Media.SoundPlayer("Tick.wav"); + var lastP = di.GetCurrentPlayersTurn(); + var lastTime = di.GetCurT(); + System.Media.SoundPlayer player = new System.Media.SoundPlayer("Tick.wav"); List times = new List(); int oldTurn = 0; bool written = false; @@ -46,13 +46,13 @@ private static void RecordGames(DataInterface di) var localPlayer = -1; while (true) { - var thisP = di.GetCurrentPlayersTurn(); - var thisTime = di.GetCurT(); - if(thisP!=lastP){// Reset timers - lastTime=thisTime; - lastP=thisP; - } - if (lastTime!=0 && (thisTime-1)*3<=(lastTime-1)*2){//Should always tick if thisTime==1 or thisTime==0 + var thisP = di.GetCurrentPlayersTurn(); + var thisTime = di.GetCurT(); + if(thisP!=lastP){// Reset timers + lastTime=thisTime; + lastP=thisP; + } + if (lastTime!=0 && (thisTime-1)*3<=(lastTime-1)*2){//Should always tick if thisTime==1 or thisTime==0 try{ player.Play(); } @@ -60,14 +60,14 @@ private static void RecordGames(DataInterface di) } lastTime=thisTime; //System.Media.SystemSounds.Exclamation.Play(); - } - // Potential reasons to beep: - // time remaining is a power of 2 - // 1 minute remaining (only beep once for this?) - // half the time you started the turn with - // When you use up your increment - // when you're significantly behind your opponent - + } + // Potential reasons to beep: + // time remaining is a power of 2 + // 1 minute remaining (only beep once for this?) + // half the time you started the turn with + // When you use up your increment + // when you're significantly behind your opponent + var cnt = di.GetChessBoardAmount(); var turn = di.GetCurrentPlayersTurn(); //turn != oldTurn is there to make sure we record times, but we shouldn't rely diff --git a/FiveDChessDataInterface/Types/ChessBoard.cs b/FiveDChessDataInterface/Types/ChessBoard.cs index 52a7327..b64d3b3 100644 --- a/FiveDChessDataInterface/Types/ChessBoard.cs +++ b/FiveDChessDataInterface/Types/ChessBoard.cs @@ -52,7 +52,7 @@ public string toFEN(string timeline, string turn){ pieces += $"{i}"; } else{ - pieces += p.SingleLetterNotation(); + pieces += p.FENSymbol(); } } } @@ -97,9 +97,15 @@ public override string ToString() } // For 5D FEN - public string SingleLetterNotation() - { - var p = this.Kind==PieceKind.Pawn?"P":this.Notation(); + public string FENSymbol() + { var p = this.Kind switch { + PieceKind.Pawn => "P*", + PieceKind.King => "K*", + PieceKind.Rook => "R*", + PieceKind.Brawn => "W*", + _ => this.Notation() + }; + if (this.IsBlack) return p.ToLower(); else return p; } diff --git a/README.md b/README.md index f5bbb79..13c8bc7 100644 --- a/README.md +++ b/README.md @@ -11,5 +11,4 @@ Note: The files produced contain your timezone (as an offset from UTC), so if yo While it should be stable for the most part, this program may still cause crashes/desyncs or other unexpected/unwanted behaviour, hence why the developers of this project cannot be held liable for any damage caused. ## Plans -Config file (name, which tags to include, sound file, how and whether to present time, always use white's perspective) -Automatic variant recognition (currently detects "Standard - Turn Zero", but I'm not sure it's always accurate when it claims that) +Config file (name, which tags to include, sound file, how and whether to include time, always use white's perspective)