Skip to content

Scaffold ClassCrawler: C# .NET 8 turn-based dungeon crawler teaching project#1

Merged
Merlissa09 merged 5 commits intomainfrom
copilot/create-classcrawler-solution
Mar 15, 2026
Merged

Scaffold ClassCrawler: C# .NET 8 turn-based dungeon crawler teaching project#1
Merlissa09 merged 5 commits intomainfrom
copilot/create-classcrawler-solution

Conversation

Copy link
Contributor

Copilot AI commented Mar 14, 2026

Bootstraps the full ClassCrawler solution from an empty repo — a teaching scaffold where all architecture is defined but core method bodies are intentionally left unimplemented for students to complete.

Solution layout

  • ClassCrawler.sln — traditional .sln format
  • ClassCrawler/ — net8.0 console app, Microsoft.Data.Sqlite 8.0.0
  • ClassCrawler.Tests/ — xUnit project referencing main app

Namespaces & types

Namespace Key types
Characters Character (abstract), Player, Enemy (abstract), Goblin, Orc, Dragon
Items Item (abstract), Weapon, Armor, Potion
Combat ICombatStrategy, CombatResult/CombatOutcome records, MeleeStrategy, MagicStrategy, RangedStrategy, CombatEngine, CharacterFactory, LootResolver
World Room, Dungeon
Events GameEventType enum, GameEvent, IGameEventListener, four concrete event types, GameEventSystem
Persistence GameState/LeaderboardEntry records, IGameRepository, SqliteGameRepository
UI GameUI

Conventions applied throughout

  • Every method body is throw new NotImplementedException() or // TODO: Implement — no logic
  • /// XML doc summaries on all public types and members
  • File-scoped namespaces, one type per file
  • Program.cs is a single line: ClassCrawler.UI.GameUI.Run(); (fully-qualified, no using directive)

Tests

Five placeholder test classes (CombatEngineTests, CombatStrategyTests, ItemTests, InventoryTests, LootResolverTests), each with one [Fact(Skip = "Not yet implemented")] test.

CI

.github/workflows/ci.yml — triggers on push: main and all PRs; steps: checkout → setup-dotnet 8 → restore → build → test. Job scoped to permissions: contents: read.

Original prompt

Create a C# .NET 8 solution called "ClassCrawler" — a turn-based dungeon crawler
game. This is a teaching scaffold: stub out the architecture but leave core method
bodies unimplemented (throw NotImplementedException or add a // TODO comment).
Students will complete the implementation.

Solution Structure

  • ClassCrawler/ → main console app project
  • ClassCrawler.Tests/ → xUnit test project referencing the main project
  • ClassCrawler.sln

Namespaces

Use ClassCrawler.Characters, ClassCrawler.Items, ClassCrawler.Combat,
ClassCrawler.World, ClassCrawler.Events, ClassCrawler.Persistence, ClassCrawler.UI

Characters (ClassCrawler.Characters)

  • Abstract class Character with properties: Name (string), Health (int),
    MaxHealth (int), AttackPower (int), Defense (int), Level (int), IsAlive (bool).
    Abstract method TakeDamage(int amount). Virtual method GetDescription().
  • Class Player : Character — adds Inventory (List), Experience (int),
    Gold (int). Methods: AddItem, RemoveItem, UseItem, AddExperience. All stubbed.
  • Abstract class Enemy : Character — adds ExperienceReward (int), GoldReward (int),
    LootTable (List). Abstract method GetAttackDescription().
  • Concrete enemies: Goblin, Orc, Dragon — each with hardcoded starting stats and
    a distinct GetAttackDescription(). Bodies stubbed.

Items (ClassCrawler.Items)

  • Abstract class Item with Name (string), Description (string), Weight (int).
    Abstract method Use(Character target).
  • Concrete classes: Weapon (DamageBonus), Armor (DefenseBonus), Potion (HealAmount).
    All Use() methods stubbed with // TODO.

Combat (ClassCrawler.Combat)

  • Interface ICombatStrategy with method Execute(Character attacker, Character target)
    returning CombatResult.
  • Record CombatResult with DamageDealt (int) and Description (string).
  • Concrete strategies: MeleeStrategy, MagicStrategy, RangedStrategy — all stubbed.
  • Character base class should have a CombatStrategy (ICombatStrategy) property.
  • Class CombatEngine with RunCombat(Player player, Enemy enemy) returning
    CombatOutcome. Stubbed.
  • Record CombatOutcome with Winner (string), TotalDamageDealt (int),
    ExperienceEarned (int), GoldEarned (int).
  • Static class CharacterFactory with CreatePlayer(string name, string characterClass)
    and CreateEnemy(string type, int scalingLevel). Stubbed.
  • Class LootResolver with ResolveLoot(Enemy enemy) returning List. Stubbed.

World (ClassCrawler.World)

  • Class Room with Name, Description, Enemies (List), Items (List),
    IsCleared (bool), Exits (Dictionary<string, Room>).
  • Class Dungeon with Rooms (List), CurrentRoom (Room).
    Method MovePlayer(string direction) returning bool. Stubbed.
    Static method GenerateDungeon() that creates a small 4-room test dungeon. Stubbed.

Events (ClassCrawler.Events)

  • Interface IGameEventListener with OnEvent(GameEvent gameEvent).
  • Abstract class GameEvent with EventType (GameEventType enum) and Message (string).
  • Enum GameEventType: PlayerLevelUp, EnemyDefeated, ItemPickedUp, PlayerDeath.
  • Concrete events: PlayerLevelUpEvent, EnemyDefeatedEvent, ItemPickedUpEvent,
    PlayerDeathEvent — each calling base constructor with appropriate EventType.
  • Static class GameEventSystem with Subscribe, Unsubscribe, Publish methods. Stubbed.

Persistence (ClassCrawler.Persistence)

  • Record GameState with PlayerName, Health, Level, CurrentRoomName,
    Inventory (List of item names).
  • Interface IGameRepository with: SaveGame(GameState), LoadGame(string playerName),
    SaveScore(string playerName, int score), GetLeaderboard() returning
    List.
  • Record LeaderboardEntry with PlayerName, Score, DateAchieved (DateTime).
  • Class SqliteGameRepository : IGameRepository — all methods stubbed.
    Add Microsoft.Data.Sqlite NuGet package reference.

UI (ClassCrawler.UI)

  • Class GameUI with a static void Run() entry point that prints
    "Welcome to ClassCrawler!" and a main menu stub (New Game / Load Game /
    Leaderboard / Quit) using a switch on console input. Stubbed.

Program.cs

Single line: GameUI.Run();

Tests (ClassCrawler.Tests)

  • Empty test classes as placeholders: CombatEngineTests, CombatStrategyTests,
    ItemTests, InventoryTests, LootResolverTests. Each with one [Fact] test marked
    with Skip = "Not yet implemented".

CI (.github/workflows/ci.yml)

GitHub Actions workflow that triggers on push to main and all pull requests.
Steps: checkout → setup-dotnet (version 8) → dotnet restore → dotnet build
--no-restore → dotnet test --no-build.

README.md

Title: ClassCrawler. Tagline: "A C# dungeon crawler where good object-oriented
design is your best weapon." Sections: Overview, Getting Started (clone +
dotnet run), Project Structure, and a placeholder Contributing section.

Additional rules

  • XML doc comments (///) on all public types and members — summary only, no params.
  • No method bodies other than property getters/setters and const...

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 14, 2026 21:32
Co-authored-by: Merlissa09 <41809281+Merlissa09@users.noreply.github.com>
Co-authored-by: Merlissa09 <41809281+Merlissa09@users.noreply.github.com>
Copilot AI changed the title [WIP] Add initial C# .NET 8 solution structure for ClassCrawler Scaffold ClassCrawler: C# .NET 8 turn-based dungeon crawler teaching project Mar 14, 2026
Copilot AI requested a review from Merlissa09 March 14, 2026 21:35
@Merlissa09 Merlissa09 marked this pull request as ready for review March 15, 2026 00:29
Copilot AI review requested due to automatic review settings March 15, 2026 00:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Bootstraps the initial ClassCrawler .NET 8 solution as a teaching scaffold: core game architecture is defined across Characters/Items/Combat/World/Events/Persistence/UI, with method bodies intentionally stubbed for students to implement, plus placeholder tests and CI.

Changes:

  • Adds the ClassCrawler console app project with stubbed domain architecture (characters, items, combat, world, events, persistence, UI).
  • Adds ClassCrawler.Tests xUnit project with skipped placeholder tests.
  • Adds GitHub Actions CI workflow and expands README with setup + structure.

Reviewed changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Adds project overview, getting started, and structure documentation.
.github/workflows/ci.yml Adds CI to restore/build/test on PRs and main pushes.
ClassCrawler.sln Adds solution file referencing app + test projects.
ClassCrawler/ClassCrawler.csproj Defines net8.0 console app + Sqlite package reference.
ClassCrawler/Program.cs Top-level entry point calling GameUI.Run().
ClassCrawler/UI/GameUI.cs Adds console UI loop scaffold with stubbed menu actions.
ClassCrawler/World/Room.cs Adds Room model (enemies/items/exits) scaffold.
ClassCrawler/World/Dungeon.cs Adds Dungeon model with stubbed movement/generation.
ClassCrawler/Persistence/GameState.cs Adds GameState record scaffold.
ClassCrawler/Persistence/IGameRepository.cs Adds persistence contract scaffold.
ClassCrawler/Persistence/LeaderboardEntry.cs Adds leaderboard record scaffold.
ClassCrawler/Persistence/SqliteGameRepository.cs Adds SQLite repository stub implementing IGameRepository.
ClassCrawler/Items/Item.cs Adds base Item abstraction scaffold.
ClassCrawler/Items/Weapon.cs Adds weapon item stub.
ClassCrawler/Items/Armor.cs Adds armor item stub.
ClassCrawler/Items/Potion.cs Adds potion item stub.
ClassCrawler/Characters/Character.cs Adds base Character scaffold (stats + combat strategy).
ClassCrawler/Characters/Player.cs Adds Player scaffold (inventory/XP/gold).
ClassCrawler/Characters/Enemy.cs Adds Enemy scaffold (rewards + loot table).
ClassCrawler/Characters/Goblin.cs Adds Goblin enemy scaffold with default stats.
ClassCrawler/Characters/Orc.cs Adds Orc enemy scaffold with default stats.
ClassCrawler/Characters/Dragon.cs Adds Dragon enemy scaffold with default stats.
ClassCrawler/Combat/ICombatStrategy.cs Adds combat strategy interface scaffold.
ClassCrawler/Combat/CombatResult.cs Adds per-action combat result record scaffold.
ClassCrawler/Combat/CombatOutcome.cs Adds encounter outcome record scaffold.
ClassCrawler/Combat/MeleeStrategy.cs Adds melee strategy stub.
ClassCrawler/Combat/MagicStrategy.cs Adds magic strategy stub.
ClassCrawler/Combat/RangedStrategy.cs Adds ranged strategy stub.
ClassCrawler/Combat/CombatEngine.cs Adds combat engine stub.
ClassCrawler/Combat/CharacterFactory.cs Adds factory stub for creating players/enemies.
ClassCrawler/Combat/LootResolver.cs Adds loot resolver stub.
ClassCrawler/Events/GameEventType.cs Adds event type enum scaffold.
ClassCrawler/Events/GameEvent.cs Adds base event scaffold.
ClassCrawler/Events/IGameEventListener.cs Adds event listener interface scaffold.
ClassCrawler/Events/GameEventSystem.cs Adds pub/sub system stub.
ClassCrawler/Events/PlayerLevelUpEvent.cs Adds concrete event type scaffold.
ClassCrawler/Events/EnemyDefeatedEvent.cs Adds concrete event type scaffold.
ClassCrawler/Events/ItemPickedUpEvent.cs Adds concrete event type scaffold.
ClassCrawler/Events/PlayerDeathEvent.cs Adds concrete event type scaffold.
ClassCrawler.Tests/ClassCrawler.Tests.csproj Adds net8.0 xUnit test project + reference to app.
ClassCrawler.Tests/CombatEngineTests.cs Adds skipped placeholder test scaffold.
ClassCrawler.Tests/CombatStrategyTests.cs Adds skipped placeholder test scaffold.
ClassCrawler.Tests/ItemTests.cs Adds skipped placeholder test scaffold.
ClassCrawler.Tests/InventoryTests.cs Adds skipped placeholder test scaffold.
ClassCrawler.Tests/LootResolverTests.cs Adds skipped placeholder test scaffold.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Merlissa09 and others added 2 commits March 14, 2026 17:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Merlissa09 <41809281+Merlissa09@users.noreply.github.com>
@Merlissa09
Copy link
Owner

@copilot apply changes based on the comments in this thread

Copy link
Contributor Author

Copilot AI commented Mar 15, 2026

@copilot apply changes based on the comments in this thread

The GUID change in ClassCrawler.sln was already applied — both project entries already use the SDK-style GUID 9A19103F-16F7-4668-BE54-9A1E7A4F7556. No further changes are needed.

@Merlissa09 Merlissa09 merged commit a1f625d into main Mar 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants