okronborgGame2D 0.0.8

dotnet add package okronborgGame2D --version 0.0.8
                    
NuGet\Install-Package okronborgGame2D -Version 0.0.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="okronborgGame2D" Version="0.0.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="okronborgGame2D" Version="0.0.8" />
                    
Directory.Packages.props
<PackageReference Include="okronborgGame2D" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add okronborgGame2D --version 0.0.8
                    
#r "nuget: okronborgGame2D, 0.0.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package okronborgGame2D@0.0.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=okronborgGame2D&version=0.0.8
                    
Install as a Cake Addin
#tool nuget:?package=okronborgGame2D&version=0.0.8
                    
Install as a Cake Tool

GameFramework2D

A turn-based 2D game framework library written in C# (.NET 8).

Projects

Project Description
GameFramework The library / NuGet package (no GUI, no Console.WriteLine)
GameConsoleApp Demo console app that uses the framework

How to Run

cd GameFrameworkSolution
dotnet run --project GameConsoleApp

How to Build the NuGet Package

cd GameFrameworkSolution/GameFramework
dotnet pack -c Release

The .nupkg file appears in bin/Release/.

How to Generate Documentation (Doxygen)

# from GameFrameworkSolution/
doxygen Doxyfile
# open docs/html/index.html

Design Patterns Implemented

Pattern Where
Template Method Creature – Hit(), ReceiveHit(), Loot() with overridable hooks
Observer Creature notifies ICreatureObserver on hit and death
Strategy IHitStrategy injected into Creature.SetHitStrategy()
Composite CompositeAttackItem groups multiple AttackItems
Decorator BoostedAttackItem / WeakenedAttackItem wrap any AttackItem
Singleton MyLogger – single logging instance with pluggable TraceListeners

SOLID Principles

Principle How
S – Single Responsibility MyLogger logs; Creature manages state; World manages layout
O – Open/Closed Creature, AttackItem, DefenceItem, WorldObject are open for extension, closed for modification
L – Liskov Substitution Hero and Monster are fully substitutable for Creature
I – Interface Segregation ICreatureObserver and IHitStrategy are small, focused interfaces
D – Dependency Inversion Creature depends on IHitStrategy (abstraction), not a concrete class

XML Configuration

GameConsoleApp/config.xml:

<?xml version="1.0" encoding="utf-8"?>
<World>
  <MaxX>50</MaxX>
  <MaxY>50</MaxY>
  <GameLevel>normal</GameLevel>
</World>

Operator Overloading

AttackItem supports > and < operators to compare items by Hit value:

if (sword > axe) Console.WriteLine("Sword is stronger");
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.8 136 4/20/2026