Skip to content

Commit

Permalink
Merge pull request #19 from CodebreakerApp/18-analyzer-package-doc-an…
Browse files Browse the repository at this point in the history
…d-cosmetic-fixes

analyzer package documentation and metadata updates
  • Loading branch information
christiannagel authored Jul 23, 2023
2 parents a5f5422 + 3c290bc commit 5994e19
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/publishnuget-nugetserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,5 @@ jobs:
name: ${{ inputs.artifact-name }}
path: packages

- name: Publish to the NuGet server
- name: Publish to the NuGet server (nupkg and snupkg)
run: dotnet nuget push "packages/*.nupkg" --api-key ${{ secrets.NUGETAPIKEY }} --source ${{ env.ARTIFACTS_URL }}

- name: Publish Symbols package to the NuGet server
run: dotnet nuget push "packages/*.snupkg" --api-key ${{ secrets.NUGETAPIKEY }} --source ${{ env.ARTIFACTS_URL }}

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected override SimpleColorResult GetCoreResult()
}

// check black
for (int i = 0; i < _game.Codes.Count(); i++)
for (int i = 0; i < _game.Codes.Length; i++)
{
// check black
if (guessPegsToCheck[i] == codesToCheck[i])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageTags>
Codebreaker;CN innovation;Analyzers;
Codebreaker;CNinnovation;GameAnalyzers;
</PackageTags>
<Description>
This library contains game analyzers for the Codebreaker app. Reference this library when creating a Codebreaker service.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace Codebreaker.GameAPIs.Contracts;

/// <summary>
/// Implement this interface with a **game** class to use it from game guess analyzers.
/// </summary>
public interface IGame
{
/// <summary>
Expand Down Expand Up @@ -28,19 +31,20 @@ public interface IGame
DateTime StartTime { get; }

/// <summary>
/// The end time of the game
/// The end time of the game.
/// This is set by the game analyzer.
/// </summary>
DateTime? EndTime { get; set; }

/// <summary>
/// The duration of the game - this might be a different value to the difference between the start and end times
/// In case the user didn't play and see the game, this time might not be calculated for the duration.
/// However, currently the duration is calculated as the difference between the start and end times.
/// Currently the duration is calculated as the difference between the start and end times. This might change in the future.
/// </summary>
TimeSpan? Duration { get; set; }

/// <summary>
/// Indicates whether the game has been won or not
/// Indicates whether the game has been won or not. This is set by the game analyzer.
/// </summary>
bool IsVictory { get; set; }

Expand All @@ -50,12 +54,13 @@ public interface IGame
int LastMoveNumber { get; set; }

/// <summary>
/// The available field values the user can chose from to position the pegs
/// The string representation of available field values the user can chose from to position the pegs.
/// Multiple categories for the field values can be defined, such as *colors* and *shapes*.
/// </summary>
IDictionary<string, IEnumerable<string>> FieldValues { get; }

/// <summary>
/// This is the code that the user needs to guess
/// This is the string representation of the code that the user needs to guess
/// </summary>
string[] Codes { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ See [Codebreakerlight](https://github.com/codebreakerapp/codebreakerlight) for a
|----------|--------------------|
| IGame | Implement this interface with your game model. This is required by the analyzer |
| IMove | Implement this interface with your move model. This is required by the analyzer |
| IGameGuessAnalyzer | If you want to create your own game type, create an anaylzer implementing this interface. Instead, you can derive your analyzer type from the base class `GameMoveAnalyzer` |
| IGameGuessAnalyzer | If you want to create your own game type, create an analyzer implementing this interface. Instead, you can derive your analyzer type from the base class `GameGuessAnalyzer` |

### Analyzers, namespace Codebreaker.GameAPIs.Analyzers

| Type | Description |
|----------|--------------------|
| GameGuessAnalyzer | This is the base class of all analyzers. Derive from this class when you create your own game type |
| ColorGameGuessAnalyzer | This anaylzer uses the types `ColorField` and `ColorResult` to analyze games moves with a list of colors. |
| SimpleGameGuessAnalyzer | This anaylzer implements the children-mode of the game and uses the types `ColorField` and `SimpleColorResult` to analyze games moves with a list of colors. |
| ShapeGameGuessAnalyzer | This anaylzer uses the types `ShapeAndColorField` and `ShapeAndColorResult` to analyze games moves with a list of shapes and colors. |
| ColorGameGuessAnalyzer | This analyzer uses the types `ColorField` and `ColorResult` to analyze games moves with a list of colors. |
| SimpleGameGuessAnalyzer | This analyzer implements the children-mode of the game and uses the types `ColorField` and `SimpleColorResult` to analyze games moves with a list of colors. |
| ShapeGameGuessAnalyzer | This analyzer uses the types `ShapeAndColorField` and `ShapeAndColorResult` to analyze games moves with a list of shapes and colors. |

### Field and Result Types, namespace Codebreaker.GameAPIs.Models

| Type | Description |
|----------|--------------------|
[ GameTypes | Constants for available game types. |
| GameTypes | Constants for available game types. |
| ColorField | A field type for color fields |
| ShapeAndColorField | A field type for shape and color fields |
| ColorResult | A result type with Correct and WrongPosition numbers |
| ShapeAndColorResult | A result type with Correct, WrongPosition and ColorOrShape (either the color or the shape is correct) numbers |
| ColorResult | A result type with `Correct` and `WrongPosition` numbers |
| ShapeAndColorResult | A result type with `Correct`, `WrongPosition` and `ColorOrShape` (either the color or the shape is correct) numbers |
| SimpleColorResult | A result type with a list to show positional results using the `ResultValue` enum. |

0 comments on commit 5994e19

Please sign in to comment.