From 4fda55e4a78b932659025c0dd5d801c48fd1c164 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 22:56:08 +0000 Subject: [PATCH 1/2] Initial plan From 130303b5082b4d633303a6b946285bb107369fb9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 22:57:43 +0000 Subject: [PATCH 2/2] Remove one-time issue creation scripts, workflows, and documentation Co-authored-by: Merlissa09 <41809281+Merlissa09@users.noreply.github.com> --- .github/workflows/create-issues.yml | 47 -- ISSUES_README.md | 104 ---- MANUAL_ISSUE_CREATION.md | 314 ---------- README.md | 32 - SOLUTION_SUMMARY.md | 155 ----- START_HERE.md | 84 --- VISUAL_GUIDE.md | 178 ------ create_issues.py | 874 ---------------------------- create_issues.sh | 829 -------------------------- create_single_issue.sh | 42 -- issues_wave1.json | 34 -- 11 files changed, 2693 deletions(-) delete mode 100644 .github/workflows/create-issues.yml delete mode 100644 ISSUES_README.md delete mode 100644 MANUAL_ISSUE_CREATION.md delete mode 100644 SOLUTION_SUMMARY.md delete mode 100644 START_HERE.md delete mode 100644 VISUAL_GUIDE.md delete mode 100644 create_issues.py delete mode 100755 create_issues.sh delete mode 100755 create_single_issue.sh delete mode 100644 issues_wave1.json diff --git a/.github/workflows/create-issues.yml b/.github/workflows/create-issues.yml deleted file mode 100644 index a9d56c4..0000000 --- a/.github/workflows/create-issues.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Create Project Issues - -# This workflow can be manually triggered to create all project issues -# It requires a GitHub token with 'issues: write' permission - -on: - workflow_dispatch: - inputs: - wave: - description: 'Which wave to create (1, 2, 3, or "all")' - required: true - default: 'all' - type: choice - options: - - all - - '1' - - '2' - - '3' - -jobs: - create-issues: - runs-on: ubuntu-latest - permissions: - issues: write - contents: read - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - - name: Create issues - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - python3 create_issues.py - - - name: Summary - run: | - echo "## Issue Creation Complete" >> $GITHUB_STEP_SUMMARY - echo "All issues for Wave ${{ github.event.inputs.wave }} have been created." >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "View them at: ${{ github.server_url }}/${{ github.repository }}/issues" >> $GITHUB_STEP_SUMMARY diff --git a/ISSUES_README.md b/ISSUES_README.md deleted file mode 100644 index 2f3d550..0000000 --- a/ISSUES_README.md +++ /dev/null @@ -1,104 +0,0 @@ -# GitHub Issues Creation Scripts - -This directory contains scripts to create all GitHub issues for the ClassCrawler project as specified in the project requirements. - -## Overview - -The scripts will create 18 GitHub issues across 3 waves: -- **Wave 1**: 5 issues (foundational classes and CI setup) -- **Wave 2**: 8 issues (game logic and patterns) -- **Wave 3**: 5 issues (persistence, UI, and testing) - -## Prerequisites - -### Option 1: Using GitHub CLI (Recommended) -- Install [GitHub CLI](https://cli.github.com/) -- Authenticate: `gh auth login` - -### Option 2: Using GitHub Token -- Create a Personal Access Token with `repo` scope -- Set environment variable: `export GITHUB_TOKEN=your_token_here` - -## Usage - -### Bash Script (Linux/Mac) -```bash -chmod +x create_issues.sh -./create_issues.sh -``` - -### Python Script (Cross-platform) -```bash -python3 create_issues.py -``` - -## Issue Structure - -Each issue includes: -- Title with point value (e.g., "[2pts] Issue Title") -- Labels: wave number (wave-1, wave-2, wave-3) and difficulty (difficulty-1, difficulty-2, difficulty-3) -- Detailed description with: - - Overview of the task - - Required properties/methods/features - - Dependencies on other issues (where applicable) - - Acceptance criteria as a checklist - -## Wave Breakdown - -### Wave 1 - Foundation (9 points total) -1. **[2pts]** Create Character abstract base class -2. **[2pts]** Create Item abstract base class and subclasses -3. **[2pts]** Create Room and Dungeon classes -4. **[1pt]** Define IGameRepository interface -5. **[2pts]** Set up GitHub Actions CI pipeline - -### Wave 2 - Game Logic (18 points total) -1. **[2pts]** Implement Player class -2. **[2pts]** Create Enemy abstract class and concrete enemy types -3. **[3pts]** Define ICombatStrategy interface and implement concrete strategies -4. **[2pts]** Implement CharacterFactory -5. **[3pts]** Implement GameEventSystem using Observer pattern -6. **[3pts]** Implement turn-based combat loop -7. **[2pts]** Implement loot system -8. **[2pts]** Implement player leveling and stat progression - -### Wave 3 - Integration (12 points total) -1. **[3pts]** Implement SqliteGameRepository -2. **[2pts]** Add leaderboard feature -3. **[3pts]** Build console UI layer -4. **[2pts]** Write unit tests — combat system -5. **[2pts]** Write unit tests — items and inventory - -**Total: 39 points across 18 issues** - -## Troubleshooting - -### Authentication Issues -If you encounter authentication errors: -1. Ensure you're authenticated with GitHub CLI: `gh auth status` -2. Or set your GitHub token: `export GITHUB_TOKEN=your_token` - -### Rate Limiting -If you hit GitHub API rate limits: -- Wait a few minutes before retrying -- Authenticated requests have higher rate limits - -### Partial Success -If some issues fail to create: -- Check the output to see which issues were created -- Re-run the script (it will attempt to create failed issues) -- Manually create remaining issues using the GitHub web interface - -## Manual Creation - -If automated creation fails, you can manually create issues using the content from the scripts. Each issue includes: -- Clear title with point value -- Appropriate labels (wave-X, difficulty-Y) -- Complete description with acceptance criteria - -## Notes - -- Issues are designed to be worked on in wave order (Wave 1 → Wave 2 → Wave 3) -- Some Wave 2 and Wave 3 issues have dependencies on Wave 1 issues -- Dependencies are noted in each issue description -- All issues include acceptance criteria as checklists for tracking progress diff --git a/MANUAL_ISSUE_CREATION.md b/MANUAL_ISSUE_CREATION.md deleted file mode 100644 index 95ef76c..0000000 --- a/MANUAL_ISSUE_CREATION.md +++ /dev/null @@ -1,314 +0,0 @@ -# Manual GitHub Issues Creation Guide - -Since automated issue creation requires elevated GitHub permissions, please follow these instructions to manually create all issues for the ClassCrawler project. - -## Quick Setup - -You have two options: - -### Option 1: Use the Automated Scripts (Recommended if you have gh CLI access) - -1. **Install and authenticate GitHub CLI** (if not already done): - ```bash - # Install gh CLI (see https://cli.github.com/) - gh auth login - ``` - -2. **Run the script**: - ```bash - # Using bash script - ./create_issues.sh - - # OR using Python script - python3 create_issues.py - ``` - -### Option 2: Create Issues Manually via GitHub Web Interface - -Follow the detailed instructions below to create each issue one by one. - ---- - -## Wave 1 Issues (5 issues - 9 points total) - -### Issue 1: [2pts] Create Character abstract base class - -**Labels**: `wave-1`, `difficulty-2` - -**Description**: -```markdown -## Description -Create the abstract Character base class with the following properties and methods. - -## Properties -- Name (string) -- Health (int) -- MaxHealth (int) -- AttackPower (int) -- Defense (int) -- Level (int) -- IsAlive (bool) - -## Methods -- **abstract** TakeDamage(int amount) -- **virtual** GetDescription() - -## Requirements -- Enforce that Health cannot go below 0 -- Implement IsAlive property logic - -## Acceptance Criteria -- [ ] Character abstract class is created with all required properties -- [ ] TakeDamage(int amount) abstract method is declared -- [ ] GetDescription() virtual method is implemented -- [ ] Health property enforces non-negative values (cannot go below 0) -- [ ] IsAlive property correctly reflects whether Health > 0 -- [ ] Class is properly documented with XML comments -``` - ---- - -### Issue 2: [2pts] Create Item abstract base class and subclasses - -**Labels**: `wave-1`, `difficulty-2` - -**Description**: -```markdown -## Description -Create an abstract Item base class and concrete subclasses for Weapon, Armor, and Potion. - -## Abstract Item Class Properties -- Name (string) -- Description (string) -- Weight (double) - -## Abstract Item Class Methods -- **abstract** Use(Character target) -- **virtual** GetDescription() - -## Concrete Subclasses - -### Weapon -- DamageBonus (int) -- Override Use() to apply damage bonus -- Override GetDescription() - -### Armor -- DefenseBonus (int) -- Override Use() to apply defense bonus -- Override GetDescription() - -### Potion -- HealAmount (int) -- Override Use() to heal target -- Override GetDescription() - -## Acceptance Criteria -- [ ] Abstract Item base class created with Name, Description, Weight properties -- [ ] Abstract Use(Character target) method declared -- [ ] Virtual GetDescription() method implemented -- [ ] Weapon subclass with DamageBonus property implemented -- [ ] Armor subclass with DefenseBonus property implemented -- [ ] Potion subclass with HealAmount property implemented -- [ ] Each subclass properly overrides Use() method -- [ ] Each subclass properly overrides GetDescription() method -- [ ] All classes documented with XML comments -``` - ---- - -### Issue 3: [2pts] Create Room and Dungeon classes - -**Labels**: `wave-1`, `difficulty-2` - -**Description**: -```markdown -## Description -Create Room and Dungeon classes for managing the game world structure. - -## Room Class -### Properties -- Name (string) -- Description (string) -- Enemies (List) -- Items (List) -- IsCleared (bool) -- Exits (Dictionary) - -## Dungeon Class -### Properties -- Rooms (List) -- CurrentRoom (Room) - -### Methods -- MovePlayer(string direction) - moves player to adjacent room -- **static** GenerateDungeon() - creates a 4-room test dungeon - -## Acceptance Criteria -- [ ] Room class created with all required properties -- [ ] Room.Exits dictionary allows connections between rooms -- [ ] Dungeon class created with Rooms and CurrentRoom properties -- [ ] MovePlayer(string direction) method implemented -- [ ] Static GenerateDungeon() method creates a 4-room test dungeon -- [ ] Test dungeon has proper room connections via Exits -- [ ] All classes documented with XML comments -``` - ---- - -### Issue 4: [1pt] Define IGameRepository interface - -**Labels**: `wave-1`, `difficulty-1` - -**Description**: -```markdown -## Description -Define the IGameRepository interface and GameState record for game persistence. This is interface and model definition only - no implementation required. - -## IGameRepository Interface Methods -- SaveGame(GameState state) -- LoadGame(string playerName) returns GameState or null -- SaveScore(string playerName, int score) -- GetLeaderboard() returns List - -## GameState Record -A record type with the following properties: -- PlayerName (string) -- Health (int) -- Level (int) -- CurrentRoomName (string) -- Inventory (List) - serialized item names - -## LeaderboardEntry Record (if needed) -- PlayerName (string) -- Score (int) -- Date (DateTime) - -## Acceptance Criteria -- [ ] IGameRepository interface defined with all required methods -- [ ] SaveGame(GameState) method signature declared -- [ ] LoadGame(string playerName) method signature declared -- [ ] SaveScore(string playerName, int score) method signature declared -- [ ] GetLeaderboard() method signature declared -- [ ] GameState record defined with all required properties -- [ ] All interfaces and records documented with XML comments -- [ ] No implementation code - interface definition only -``` - ---- - -### Issue 5: [2pts] Set up GitHub Actions CI pipeline - -**Labels**: `wave-1`, `difficulty-2` - -**Description**: -```markdown -## Description -Create a GitHub Actions workflow for continuous integration that builds and tests the project. - -## Workflow Configuration -- File: .github/workflows/ci.yml -- Triggers: push to main branch and all pull requests -- .NET version: 8 - -## Workflow Steps -1. Checkout code -2. Setup .NET 8 -3. Restore dependencies (dotnet restore) -4. Build project (dotnet build) -5. Run tests (dotnet test) - -## Additional Requirements -- Add a passing build badge to README.md -- Badge should link to the workflow runs -- Badge format: ![Build Status](workflow-badge-url) - -## Acceptance Criteria -- [ ] .github/workflows/ci.yml file created -- [ ] Workflow triggers on push to main branch -- [ ] Workflow triggers on all pull requests -- [ ] Checkout step included -- [ ] Setup .NET 8 step included -- [ ] dotnet restore step included -- [ ] dotnet build step included -- [ ] dotnet test step included -- [ ] Build badge added to README.md -- [ ] Badge correctly shows build status -- [ ] Workflow runs successfully on push -``` - ---- - -## Wave 2 Issues (8 issues - 18 points total) - -For Wave 2 issues, please refer to the `create_issues.sh` or `create_issues.py` scripts which contain all the detailed descriptions. The titles are: - -1. **[2pts] Implement Player class** (wave-2, difficulty-2) -2. **[2pts] Create Enemy abstract class and concrete enemy types** (wave-2, difficulty-2) -3. **[3pts] Define ICombatStrategy interface and implement concrete strategies** (wave-2, difficulty-3) -4. **[2pts] Implement CharacterFactory** (wave-2, difficulty-2) -5. **[3pts] Implement GameEventSystem using Observer pattern** (wave-2, difficulty-3) -6. **[3pts] Implement turn-based combat loop** (wave-2, difficulty-3) -7. **[2pts] Implement loot system** (wave-2, difficulty-2) -8. **[2pts] Implement player leveling and stat progression** (wave-2, difficulty-2) - ---- - -## Wave 3 Issues (5 issues - 12 points total) - -For Wave 3 issues, please refer to the `create_issues.sh` or `create_issues.py` scripts which contain all the detailed descriptions. The titles are: - -1. **[3pts] Implement SqliteGameRepository** (wave-3, difficulty-3) -2. **[2pts] Add leaderboard feature** (wave-3, difficulty-2) -3. **[3pts] Build console UI layer** (wave-3, difficulty-3) -4. **[2pts] Write unit tests — combat system** (wave-3, difficulty-2) -5. **[2pts] Write unit tests — items and inventory** (wave-3, difficulty-2) - ---- - -## How to Create Issues via GitHub Web Interface - -1. Go to your repository: https://github.com/Merlissa09/ClassCrawler -2. Click on the "Issues" tab -3. Click the green "New issue" button -4. Copy the title from above (e.g., `[2pts] Create Character abstract base class`) -5. Copy the description from above -6. Add labels on the right side: - - Add the wave label (e.g., `wave-1`) - - Add the difficulty label (e.g., `difficulty-2`) -7. Click "Submit new issue" -8. Repeat for all 18 issues - ---- - -## Creating Labels (if they don't exist) - -If the labels don't exist yet, create them first: - -1. Go to Issues → Labels -2. Click "New label" -3. Create these labels: - - `wave-1` (color: #0E8A16 - green) - - `wave-2` (color: #FBCA04 - yellow) - - `wave-3` (color: #D93F0B - red) - - `difficulty-1` (color: #C5DEF5 - light blue) - - `difficulty-2` (color: #5319E7 - purple) - - `difficulty-3` (color: #B60205 - dark red) - ---- - -## Tips - -- Create issues in order (Wave 1 → Wave 2 → Wave 3) as some have dependencies -- Use the checklist in each issue's acceptance criteria to track progress -- The full issue descriptions are available in `create_issues.sh` and `create_issues.py` -- Consider creating a GitHub Project board to organize and track these issues - ---- - -## Total Points - -- **Wave 1**: 9 points -- **Wave 2**: 18 points -- **Wave 3**: 12 points -- **Total**: 39 points across 18 issues diff --git a/README.md b/README.md index a11155e..3ac4c3d 100644 --- a/README.md +++ b/README.md @@ -46,38 +46,6 @@ ClassCrawler/ └── ClassCrawler.sln ``` -## Creating Project Issues - -This repository includes scripts to create all required GitHub issues for the project. The issues are organized into three waves: - -- **Wave 1** (9 points): Foundation - Core classes and CI setup -- **Wave 2** (18 points): Game Logic - Combat, events, and patterns -- **Wave 3** (12 points): Integration - Persistence, UI, and tests - -### Automated Creation - -#### Option 1: Using GitHub Actions (Easiest) -1. Go to the "Actions" tab in your repository -2. Select "Create Project Issues" workflow -3. Click "Run workflow" -4. Choose which wave to create (or "all") - -#### Option 2: Using Scripts -```bash -# Using bash script (Linux/Mac) -chmod +x create_issues.sh -./create_issues.sh - -# OR using Python script (Cross-platform) -python3 create_issues.py -``` - -### Manual Creation - -If automated methods don't work, follow the step-by-step instructions in `MANUAL_ISSUE_CREATION.md`. - -For complete documentation, see `ISSUES_README.md`. - ## Contributing diff --git a/SOLUTION_SUMMARY.md b/SOLUTION_SUMMARY.md deleted file mode 100644 index de1722c..0000000 --- a/SOLUTION_SUMMARY.md +++ /dev/null @@ -1,155 +0,0 @@ -# GitHub Issues Creation - Complete Solution - -## Summary - -I have created a comprehensive solution for creating all 18 GitHub issues for your ClassCrawler project. Due to GitHub API permission limitations, I cannot directly create the issues from this environment, but I've provided **three different methods** you can use. - -## What Was Created - -### 1. Automation Scripts -- **`create_issues.sh`** - Bash script for Linux/Mac -- **`create_issues.py`** - Python script for cross-platform use -- **`create_single_issue.sh`** - Helper script for API-based creation - -### 2. GitHub Actions Workflow -- **`.github/workflows/create-issues.yml`** - Automated workflow -- Can be triggered manually from your GitHub repository's Actions tab -- Requires no local setup - -### 3. Documentation -- **`ISSUES_README.md`** - Complete guide for all methods -- **`MANUAL_ISSUE_CREATION.md`** - Step-by-step manual creation guide -- **`issues_wave1.json`** - JSON template example -- **`README.md`** - Updated with issue creation instructions - -## Recommended Approach - -### 🎯 Best Option: GitHub Actions Workflow - -1. Open your repository: https://github.com/Merlissa09/ClassCrawler -2. Go to the **Actions** tab -3. Select **"Create Project Issues"** from the workflow list (left sidebar) -4. Click **"Run workflow"** (button on the right) -5. Select wave to create (or "all" to create all 18 issues) -6. Click **"Run workflow"** to start -7. Wait for completion (~30 seconds) -8. Check the **Issues** tab to see all created issues - -### Alternative Option: Command Line - -If you have GitHub CLI installed and authenticated: - -```bash -cd /path/to/ClassCrawler -./create_issues.sh -``` - -Or with Python: -```bash -python3 create_issues.py -``` - -### Manual Option - -If automation isn't working, see `MANUAL_ISSUE_CREATION.md` for step-by-step instructions to create each issue via the GitHub web interface. - -## What Issues Will Be Created - -### Wave 1 (5 issues - 9 points) -1. [2pts] Create Character abstract base class -2. [2pts] Create Item abstract base class and subclasses -3. [2pts] Create Room and Dungeon classes -4. [1pt] Define IGameRepository interface -5. [2pts] Set up GitHub Actions CI pipeline - -### Wave 2 (8 issues - 18 points) -1. [2pts] Implement Player class -2. [2pts] Create Enemy abstract class and concrete enemy types -3. [3pts] Define ICombatStrategy interface and implement concrete strategies -4. [2pts] Implement CharacterFactory -5. [3pts] Implement GameEventSystem using Observer pattern -6. [3pts] Implement turn-based combat loop -7. [2pts] Implement loot system -8. [2pts] Implement player leveling and stat progression - -### Wave 3 (5 issues - 12 points) -1. [3pts] Implement SqliteGameRepository -2. [2pts] Add leaderboard feature -3. [3pts] Build console UI layer -4. [2pts] Write unit tests — combat system -5. [2pts] Write unit tests — items and inventory - -**Total: 18 issues, 39 points** - -## Issue Features - -Each issue includes: -- ✅ Clear title with point value -- ✅ Appropriate labels (wave-X, difficulty-Y) -- ✅ Detailed description -- ✅ Required properties and methods -- ✅ Dependencies noted (where applicable) -- ✅ Acceptance criteria as checklist -- ✅ Implementation requirements - -## Labels to Create - -If labels don't exist in your repository, create them: - -| Label | Description | Color | -|-------|-------------|-------| -| wave-1 | Foundation wave | #0E8A16 (green) | -| wave-2 | Game logic wave | #FBCA04 (yellow) | -| wave-3 | Integration wave | #D93F0B (red) | -| difficulty-1 | Easy tasks | #C5DEF5 (light blue) | -| difficulty-2 | Medium tasks | #5319E7 (purple) | -| difficulty-3 | Hard tasks | #B60205 (dark red) | - -## Troubleshooting - -### GitHub Actions Workflow Not Visible -- The workflow file has been committed to `.github/workflows/create-issues.yml` -- It should appear in the Actions tab after the PR is merged -- Make sure you're looking at the correct branch - -### Script Authentication Errors -```bash -# Authenticate GitHub CLI -gh auth login - -# Or set token environment variable -export GITHUB_TOKEN=your_token_here -``` - -### API Rate Limiting -- Wait a few minutes between retry attempts -- Authenticated requests have higher rate limits - -## Next Steps - -1. **Choose your preferred method** (GitHub Actions recommended) -2. **Create the issues** using that method -3. **Verify all 18 issues** were created successfully -4. **Begin working on Wave 1** issues first -5. **Track progress** using the acceptance criteria checklists - -## Support - -If you encounter any issues: -1. Check the documentation files mentioned above -2. Ensure you have proper GitHub permissions -3. Try the manual creation method as a fallback -4. All issue content is pre-written and ready to use - ---- - -**Files in this PR:** -- `create_issues.sh` - Bash automation script -- `create_issues.py` - Python automation script -- `create_single_issue.sh` - API helper script -- `.github/workflows/create-issues.yml` - GitHub Actions workflow -- `ISSUES_README.md` - Comprehensive documentation -- `MANUAL_ISSUE_CREATION.md` - Manual creation guide -- `issues_wave1.json` - JSON template example -- `README.md` - Updated with instructions -- `SOLUTION_SUMMARY.md` - This file diff --git a/START_HERE.md b/START_HERE.md deleted file mode 100644 index de47e78..0000000 --- a/START_HERE.md +++ /dev/null @@ -1,84 +0,0 @@ -# 🎯 START HERE: GitHub Issues Creation - -## Quick Start - -**Want to create all 18 GitHub issues for this project?** - -👉 **Read this first:** [VISUAL_GUIDE.md](VISUAL_GUIDE.md) - Quick overview with diagrams - -Then choose your method: - -### 🚀 Method 1: GitHub Actions (Easiest - RECOMMENDED) -1. Merge this PR -2. Go to your repository's **Actions** tab -3. Select **"Create Project Issues"** workflow -4. Click **"Run workflow"** -5. Choose "all" to create all 18 issues -6. Done in ~30 seconds! - -### 💻 Method 2: Command Line -```bash -# Using Bash -./create_issues.sh - -# OR using Python -python3 create_issues.py -``` -Requires: GitHub CLI installed and authenticated (`gh auth login`) - -### ✍️ Method 3: Manual -Follow step-by-step instructions in [MANUAL_ISSUE_CREATION.md](MANUAL_ISSUE_CREATION.md) - ---- - -## 📚 Documentation - -- **[VISUAL_GUIDE.md](VISUAL_GUIDE.md)** - Quick visual overview (START HERE!) -- **[SOLUTION_SUMMARY.md](SOLUTION_SUMMARY.md)** - Detailed explanation of the solution -- **[ISSUES_README.md](ISSUES_README.md)** - Complete technical documentation -- **[MANUAL_ISSUE_CREATION.md](MANUAL_ISSUE_CREATION.md)** - Step-by-step manual process - ---- - -## 📋 What You're Creating - -**18 GitHub Issues** organized into 3 waves: - -| Wave | Issues | Points | Focus | -|------|--------|--------|-------| -| 1 | 5 | 9 | Foundation (Character, Item, Room, Repository, CI) | -| 2 | 8 | 18 | Game Logic (Player, Enemy, Combat, Events, Loot) | -| 3 | 5 | 12 | Integration (Database, UI, Tests) | -| **Total** | **18** | **39** | Complete game project | - ---- - -## ⚡ One-Minute Setup - -**Just want to get started quickly?** - -1. **Merge this PR** ✓ -2. **Actions tab** → "Create Project Issues" → **Run workflow** ✓ -3. **Start coding** Wave 1 issues! ✓ - ---- - -## 🆘 Need Help? - -- **Workflow not showing?** → Make sure PR is merged first -- **Permission errors?** → See [ISSUES_README.md](ISSUES_README.md) troubleshooting section -- **Want to understand more?** → Read [SOLUTION_SUMMARY.md](SOLUTION_SUMMARY.md) -- **Prefer manual creation?** → Follow [MANUAL_ISSUE_CREATION.md](MANUAL_ISSUE_CREATION.md) - ---- - -## 🎉 What's Next? - -After creating the issues: -1. ✅ Review all issues in your Issues tab -2. ✅ Create a Project board to organize them -3. ✅ Start with Wave 1 issues -4. ✅ Use acceptance criteria as your checklist -5. ✅ Move to Wave 2, then Wave 3 - -**Happy coding!** 🚀 diff --git a/VISUAL_GUIDE.md b/VISUAL_GUIDE.md deleted file mode 100644 index 687c5f2..0000000 --- a/VISUAL_GUIDE.md +++ /dev/null @@ -1,178 +0,0 @@ -# GitHub Issues Creation - Quick Visual Guide - -## 📋 What You're Creating - -``` -Wave 1: Foundation (5 issues, 9 pts) -├── Character base class [2pts] -├── Item classes [2pts] -├── Room & Dungeon [2pts] -├── IGameRepository [1pt] -└── CI Pipeline [2pts] - -Wave 2: Game Logic (8 issues, 18 pts) -├── Player class [2pts] -├── Enemy classes [2pts] -├── Combat Strategy [3pts] -├── CharacterFactory [2pts] -├── Event System [3pts] -├── Combat Engine [3pts] -├── Loot System [2pts] -└── Leveling System [2pts] - -Wave 3: Integration (5 issues, 12 pts) -├── SQLite Repository [3pts] -├── Leaderboard [2pts] -├── Console UI [3pts] -├── Combat Tests [2pts] -└── Item Tests [2pts] - -Total: 18 issues, 39 points -``` - -## 🚀 Three Ways to Create Issues - -### Method 1: GitHub Actions ⭐ RECOMMENDED - -``` -┌─────────────────────────────────────────┐ -│ 1. Go to Actions tab in GitHub │ -│ 2. Select "Create Project Issues" │ -│ 3. Click "Run workflow" │ -│ 4. Choose wave (or "all") │ -│ 5. Click "Run workflow" again │ -│ 6. Wait ~30 seconds │ -│ 7. Check Issues tab │ -└─────────────────────────────────────────┘ -``` - -**Pros**: No local setup, fully automated -**Cons**: Requires workflow permissions (should work by default) - ---- - -### Method 2: Command Line Scripts - -#### Option A: Bash Script -```bash -cd ClassCrawler -./create_issues.sh -``` - -#### Option B: Python Script -```bash -cd ClassCrawler -python3 create_issues.py -``` - -**Prerequisites**: GitHub CLI installed and authenticated -```bash -gh auth login -``` - -**Pros**: Fast, automated, can retry easily -**Cons**: Requires local setup and GitHub CLI - ---- - -### Method 3: Manual Creation - -``` -For each issue: -1. Go to https://github.com/Merlissa09/ClassCrawler/issues -2. Click "New issue" -3. Copy title from MANUAL_ISSUE_CREATION.md -4. Copy description from MANUAL_ISSUE_CREATION.md -5. Add labels: wave-X, difficulty-Y -6. Click "Submit new issue" -7. Repeat for remaining issues -``` - -**Pros**: Always works, no dependencies -**Cons**: Time-consuming (15-20 minutes for all 18) - ---- - -## 📁 Files in This PR - -``` -ClassCrawler/ -├── .github/workflows/ -│ └── create-issues.yml ← GitHub Actions workflow -├── create_issues.sh ← Bash script -├── create_issues.py ← Python script -├── create_single_issue.sh ← API helper -├── SOLUTION_SUMMARY.md ← This guide -├── ISSUES_README.md ← Comprehensive docs -├── MANUAL_ISSUE_CREATION.md ← Step-by-step manual -├── VISUAL_GUIDE.md ← Quick reference (this file) -├── issues_wave1.json ← JSON template example -└── README.md ← Updated with instructions -``` - -## 🏷️ Labels to Create First (if needed) - -| Label | Color | Description | -|-------|-------|-------------| -| wave-1 | 🟢 #0E8A16 | Foundation | -| wave-2 | 🟡 #FBCA04 | Game Logic | -| wave-3 | 🔴 #D93F0B | Integration | -| difficulty-1 | 🔵 #C5DEF5 | Easy | -| difficulty-2 | 🟣 #5319E7 | Medium | -| difficulty-3 | ⚫ #B60205 | Hard | - -Create at: https://github.com/Merlissa09/ClassCrawler/labels - ---- - -## ⚡ Quick Start - -**Just want to get started?** - -1. **Merge this PR** -2. **Go to Actions tab** -3. **Run "Create Project Issues" workflow** -4. **Start coding Wave 1!** - ---- - -## 🆘 Troubleshooting - -### "Workflow not found" -→ Make sure the PR is merged first -→ Check .github/workflows/ directory exists - -### "Permission denied" on scripts -→ Run: `chmod +x create_issues.sh` - -### "gh auth failed" -→ Run: `gh auth login` and follow prompts - -### "API rate limit" -→ Wait a few minutes, authenticated requests have higher limits - -### All else fails? -→ Use Method 3 (manual creation) with MANUAL_ISSUE_CREATION.md - ---- - -## 📊 Progress Tracking - -After creating issues, track them with: -- ✅ Project boards -- ✅ Milestones (one per wave) -- ✅ Acceptance criteria checklists in each issue - ---- - -## 💡 Tips - -- Create issues **in wave order** (Wave 1 → 2 → 3) -- Some Wave 2/3 issues **depend on Wave 1** -- Use **acceptance criteria** as your checklist -- Each issue has **point values** for effort estimation -- **Total 39 points** = good-sized project - ---- - -**Ready to start?** Pick your method above and create those issues! 🎯 diff --git a/create_issues.py b/create_issues.py deleted file mode 100644 index 190acd8..0000000 --- a/create_issues.py +++ /dev/null @@ -1,874 +0,0 @@ -#!/usr/bin/env python3 -""" -Script to create GitHub issues for ClassCrawler project. -This script creates all issues across Wave 1, Wave 2, and Wave 3. - -Usage: - python3 create_issues.py - -Requires: - - GitHub CLI (gh) installed and authenticated - - Or set GITHUB_TOKEN environment variable for API access -""" - -import subprocess -import sys - -REPO = "Merlissa09/ClassCrawler" - -def create_issue(title, labels, body): - """Create a GitHub issue using gh CLI.""" - try: - cmd = [ - "gh", "issue", "create", - "--repo", REPO, - "--title", title, - "--label", labels, - "--body", body - ] - result = subprocess.run(cmd, capture_output=True, text=True, check=True) - print(f"✓ Created: {title}") - return True - except subprocess.CalledProcessError as e: - print(f"✗ Failed to create: {title}") - print(f" Error: {e.stderr}") - return False - -def main(): - print("Creating GitHub issues for ClassCrawler...") - print("=" * 50) - print() - - issues_created = 0 - issues_failed = 0 - - # Wave 1 Issues - print("Creating Wave 1 issues...") - - wave1_issues = [ - { - "title": "[2pts] Create Character abstract base class", - "labels": "wave-1,difficulty-2", - "body": """## Description -Create the abstract Character base class with the following properties and methods. - -## Properties -- Name (string) -- Health (int) -- MaxHealth (int) -- AttackPower (int) -- Defense (int) -- Level (int) -- IsAlive (bool) - -## Methods -- **abstract** TakeDamage(int amount) -- **virtual** GetDescription() - -## Requirements -- Enforce that Health cannot go below 0 -- Implement IsAlive property logic - -## Acceptance Criteria -- [ ] Character abstract class is created with all required properties -- [ ] TakeDamage(int amount) abstract method is declared -- [ ] GetDescription() virtual method is implemented -- [ ] Health property enforces non-negative values (cannot go below 0) -- [ ] IsAlive property correctly reflects whether Health > 0 -- [ ] Class is properly documented with XML comments""" - }, - { - "title": "[2pts] Create Item abstract base class and subclasses", - "labels": "wave-1,difficulty-2", - "body": """## Description -Create an abstract Item base class and concrete subclasses for Weapon, Armor, and Potion. - -## Abstract Item Class Properties -- Name (string) -- Description (string) -- Weight (double) - -## Abstract Item Class Methods -- **abstract** Use(Character target) -- **virtual** GetDescription() - -## Concrete Subclasses - -### Weapon -- DamageBonus (int) -- Override Use() to apply damage bonus -- Override GetDescription() - -### Armor -- DefenseBonus (int) -- Override Use() to apply defense bonus -- Override GetDescription() - -### Potion -- HealAmount (int) -- Override Use() to heal target -- Override GetDescription() - -## Acceptance Criteria -- [ ] Abstract Item base class created with Name, Description, Weight properties -- [ ] Abstract Use(Character target) method declared -- [ ] Virtual GetDescription() method implemented -- [ ] Weapon subclass with DamageBonus property implemented -- [ ] Armor subclass with DefenseBonus property implemented -- [ ] Potion subclass with HealAmount property implemented -- [ ] Each subclass properly overrides Use() method -- [ ] Each subclass properly overrides GetDescription() method -- [ ] All classes documented with XML comments""" - }, - { - "title": "[2pts] Create Room and Dungeon classes", - "labels": "wave-1,difficulty-2", - "body": """## Description -Create Room and Dungeon classes for managing the game world structure. - -## Room Class -### Properties -- Name (string) -- Description (string) -- Enemies (List) -- Items (List) -- IsCleared (bool) -- Exits (Dictionary) - -## Dungeon Class -### Properties -- Rooms (List) -- CurrentRoom (Room) - -### Methods -- MovePlayer(string direction) - moves player to adjacent room -- **static** GenerateDungeon() - creates a 4-room test dungeon - -## Acceptance Criteria -- [ ] Room class created with all required properties -- [ ] Room.Exits dictionary allows connections between rooms -- [ ] Dungeon class created with Rooms and CurrentRoom properties -- [ ] MovePlayer(string direction) method implemented -- [ ] Static GenerateDungeon() method creates a 4-room test dungeon -- [ ] Test dungeon has proper room connections via Exits -- [ ] All classes documented with XML comments""" - }, - { - "title": "[1pt] Define IGameRepository interface", - "labels": "wave-1,difficulty-1", - "body": """## Description -Define the IGameRepository interface and GameState record for game persistence. This is interface and model definition only - no implementation required. - -## IGameRepository Interface Methods -- SaveGame(GameState state) -- LoadGame(string playerName) returns GameState or null -- SaveScore(string playerName, int score) -- GetLeaderboard() returns List - -## GameState Record -A record type with the following properties: -- PlayerName (string) -- Health (int) -- Level (int) -- CurrentRoomName (string) -- Inventory (List) - serialized item names - -## LeaderboardEntry Record (if needed) -- PlayerName (string) -- Score (int) -- Date (DateTime) - -## Acceptance Criteria -- [ ] IGameRepository interface defined with all required methods -- [ ] SaveGame(GameState) method signature declared -- [ ] LoadGame(string playerName) method signature declared -- [ ] SaveScore(string playerName, int score) method signature declared -- [ ] GetLeaderboard() method signature declared -- [ ] GameState record defined with all required properties -- [ ] All interfaces and records documented with XML comments -- [ ] No implementation code - interface definition only""" - }, - { - "title": "[2pts] Set up GitHub Actions CI pipeline", - "labels": "wave-1,difficulty-2", - "body": """## Description -Create a GitHub Actions workflow for continuous integration that builds and tests the project. - -## Workflow Configuration -- File: .github/workflows/ci.yml -- Triggers: push to main branch and all pull requests -- .NET version: 8 - -## Workflow Steps -1. Checkout code -2. Setup .NET 8 -3. Restore dependencies (dotnet restore) -4. Build project (dotnet build) -5. Run tests (dotnet test) - -## Additional Requirements -- Add a passing build badge to README.md -- Badge should link to the workflow runs -- Badge format: ![Build Status](workflow-badge-url) - -## Acceptance Criteria -- [ ] .github/workflows/ci.yml file created -- [ ] Workflow triggers on push to main branch -- [ ] Workflow triggers on all pull requests -- [ ] Checkout step included -- [ ] Setup .NET 8 step included -- [ ] dotnet restore step included -- [ ] dotnet build step included -- [ ] dotnet test step included -- [ ] Build badge added to README.md -- [ ] Badge correctly shows build status -- [ ] Workflow runs successfully on push""" - } - ] - - for issue in wave1_issues: - if create_issue(issue["title"], issue["labels"], issue["body"]): - issues_created += 1 - else: - issues_failed += 1 - - print() - print("Wave 1 issues completed!") - print() - - # Wave 2 Issues - print("Creating Wave 2 issues...") - - wave2_issues = [ - { - "title": "[2pts] Implement Player class", - "labels": "wave-2,difficulty-2", - "body": """## Description -Implement the Player class that inherits from Character base class. - -**Depends on:** Character base class issue - -## Additional Properties -- Inventory (List) -- Experience (int) -- Gold (int) - -## Methods -- AddItem(Item item) -- RemoveItem(Item item) -- UseItem(Item item) -- AddExperience(int amount) -- Override GetDescription() to include inventory summary - -## Requirements -- AddExperience should include a stub for triggering level-up -- Inventory operations should properly manage the item list -- GetDescription should show player stats and inventory summary - -## Acceptance Criteria -- [ ] Player class inherits from Character -- [ ] Inventory property (List) implemented -- [ ] Experience property implemented -- [ ] Gold property implemented -- [ ] AddItem(Item item) method implemented -- [ ] RemoveItem(Item item) method implemented -- [ ] UseItem(Item item) method implemented -- [ ] AddExperience(int amount) method with level-up stub implemented -- [ ] GetDescription() overridden to include inventory summary -- [ ] Class documented with XML comments""" - }, - { - "title": "[2pts] Create Enemy abstract class and concrete enemy types", - "labels": "wave-2,difficulty-2", - "body": """## Description -Create abstract Enemy class and concrete enemy type implementations. - -**Depends on:** Character base class issue - -## Enemy Abstract Class -Inherits from Character and adds: -- ExperienceReward (int) -- GoldReward (int) -- LootTable (List) -- **abstract** GetAttackDescription() method - -## Concrete Enemy Types - -### Goblin -- Low stats (low health, attack, defense) -- Distinct flavor text in GetAttackDescription() - -### Orc -- High health -- Medium attack and defense -- Distinct flavor text in GetAttackDescription() - -### Dragon -- Boss tier stats (very high in all categories) -- Distinct flavor text in GetAttackDescription() - -## Acceptance Criteria -- [ ] Enemy abstract class inherits from Character -- [ ] ExperienceReward property added -- [ ] GoldReward property added -- [ ] LootTable property (List) added -- [ ] Abstract GetAttackDescription() method declared -- [ ] Goblin concrete class implemented with low stats -- [ ] Orc concrete class implemented with high health -- [ ] Dragon concrete class implemented with boss-tier stats -- [ ] Each enemy type has distinct flavor text -- [ ] All classes documented with XML comments""" - }, - { - "title": "[3pts] Define ICombatStrategy interface and implement concrete strategies", - "labels": "wave-2,difficulty-3", - "body": """## Description -Implement the Strategy pattern for combat actions using ICombatStrategy interface. - -**Depends on:** Character base class issue - -## ICombatStrategy Interface -- Execute(Character attacker, Character target) returns CombatResult - -## CombatResult Class -- DamageDealt (int) -- AttackerName (string) -- TargetName (string) -- Message (string) - -## Concrete Strategy Implementations - -### MeleeStrategy -- Direct physical damage calculation -- Uses attacker's AttackPower and target's Defense - -### MagicStrategy -- Magic damage that partially bypasses defense -- Different calculation than melee - -### RangedStrategy -- Ranged attack with different mechanics -- Unique damage calculation - -## Integration -- Add CombatStrategy property to Character base class -- Include code comment explaining Strategy pattern choice - -## Acceptance Criteria -- [ ] ICombatStrategy interface defined with Execute method -- [ ] CombatResult class created with all properties -- [ ] MeleeStrategy implemented -- [ ] MagicStrategy implemented -- [ ] RangedStrategy implemented -- [ ] Character.CombatStrategy property added -- [ ] Each strategy has distinct damage calculation -- [ ] Code comment explaining Strategy pattern included -- [ ] All classes and interfaces documented with XML comments""" - }, - { - "title": "[2pts] Implement CharacterFactory", - "labels": "wave-2,difficulty-2", - "body": """## Description -Implement a Factory pattern for creating Player and Enemy instances with preset configurations. - -**Depends on:** Character and Enemy classes issues - -## CharacterFactory Static Class - -### CreatePlayer(string name, string characterClass) -Supports three character classes: -- **warrior**: High health and defense, MeleeStrategy -- **mage**: High attack power, low defense, MagicStrategy -- **rogue**: Balanced stats, RangedStrategy - -### CreateEnemy(string type, int scalingLevel) -Creates enemies with scaled stats: -- **goblin**: Base stats scaled by level -- **orc**: Base stats scaled by level -- **dragon**: Base stats scaled by level - -## Requirements -- Each character class has distinct stat distributions -- Each gets an appropriate default ICombatStrategy -- Enemy stats scale with level parameter -- Include code comment explaining Factory pattern choice - -## Acceptance Criteria -- [ ] CharacterFactory static class created -- [ ] CreatePlayer(string name, string characterClass) implemented -- [ ] Warrior class configuration with MeleeStrategy -- [ ] Mage class configuration with MagicStrategy -- [ ] Rogue class configuration with RangedStrategy -- [ ] CreateEnemy(string type, int scalingLevel) implemented -- [ ] Goblin creation with stat scaling -- [ ] Orc creation with stat scaling -- [ ] Dragon creation with stat scaling -- [ ] Code comment explaining Factory pattern choice -- [ ] Class documented with XML comments""" - }, - { - "title": "[3pts] Implement GameEventSystem using Observer pattern", - "labels": "wave-2,difficulty-3", - "body": """## Description -Implement an event system using the Observer pattern for game-wide notifications. - -## IGameEventListener Interface -- OnEvent(GameEvent gameEvent) - -## GameEvent Abstract Base Class -- EventType (enum) -- Message (string) -- Timestamp (DateTime) - -## EventType Enum -- PlayerLevelUp -- EnemyDefeated -- ItemPickedUp -- PlayerDeath - -## Concrete Event Classes -- PlayerLevelUpEvent (includes new level) -- EnemyDefeatedEvent (includes enemy name, XP, gold) -- ItemPickedUpEvent (includes item name) -- PlayerDeathEvent (includes cause of death) - -## GameEventSystem Static Class -- Subscribe(IGameEventListener listener) -- Unsubscribe(IGameEventListener listener) -- Publish(GameEvent gameEvent) - -## Demo Implementation -- GameLogger class implements IGameEventListener -- Prints events to console with formatting - -## Requirements -- Include code comment explaining Observer pattern choice -- Thread-safe implementation (not required if single-threaded) - -## Acceptance Criteria -- [ ] IGameEventListener interface defined -- [ ] GameEvent abstract base class created -- [ ] EventType enum defined -- [ ] PlayerLevelUpEvent implemented -- [ ] EnemyDefeatedEvent implemented -- [ ] ItemPickedUpEvent implemented -- [ ] PlayerDeathEvent implemented -- [ ] GameEventSystem static class with Subscribe/Unsubscribe/Publish -- [ ] GameLogger demo listener implemented -- [ ] Code comment explaining Observer pattern choice -- [ ] All classes documented with XML comments""" - }, - { - "title": "[3pts] Implement turn-based combat loop", - "labels": "wave-2,difficulty-3", - "body": """## Description -Implement turn-based combat system with CombatEngine class. - -**Depends on:** Character, Player, Enemy, and ICombatStrategy issues - -## CombatEngine Class - -### RunCombat(Player player, Enemy enemy) -Returns CombatOutcome with: -- Winner (Character) -- TotalDamageDealt (int) -- ExperienceEarned (int) -- GoldEarned (int) -- TurnCount (int) - -## Combat Rules -- Player attacks first each turn -- Each character uses their ICombatStrategy.Execute() -- Combat continues until one character dies (Health <= 0) -- Publishes events via GameEventSystem: - - EnemyDefeatedEvent if player wins - - PlayerDeathEvent if enemy wins - -## Requirements -- No UI/console output in CombatEngine -- Pure game logic only -- Combat result encapsulates all outcome data - -## Acceptance Criteria -- [ ] CombatEngine class created -- [ ] RunCombat(Player player, Enemy enemy) method implemented -- [ ] CombatOutcome class defined with all properties -- [ ] Player attacks first each turn -- [ ] Uses ICombatStrategy.Execute() for attacks -- [ ] Combat continues until one character's Health <= 0 -- [ ] Publishes EnemyDefeatedEvent on enemy death -- [ ] Publishes PlayerDeathEvent on player death -- [ ] Returns complete CombatOutcome -- [ ] No UI logic in class -- [ ] Class documented with XML comments""" - }, - { - "title": "[2pts] Implement loot system", - "labels": "wave-2,difficulty-2", - "body": """## Description -Implement loot generation system with configurable drop rates. - -**Depends on:** Enemy and Item classes issues - -## LootResolver Class - -### ResolveLoot(Enemy enemy) -Returns List based on: -- Enemy's LootTable -- Configurable drop probability per item -- Special rules for boss enemies - -## Loot Rules -- Each item in LootTable has a drop probability (0.0 - 1.0) -- Dragon always drops at least one item -- Gold always equals enemy.GoldReward -- Random seed should be injectable for deterministic testing - -## Requirements -- Constructor accepts optional Random seed for testing -- Default uses unseeded Random for production -- Item drop rates are configurable per item - -## Acceptance Criteria -- [ ] LootResolver class created -- [ ] ResolveLoot(Enemy enemy) method implemented -- [ ] Returns List based on LootTable -- [ ] Supports configurable drop probability per item -- [ ] Dragon always drops at least one item -- [ ] Gold amount equals enemy.GoldReward -- [ ] Constructor accepts optional Random seed -- [ ] Deterministic loot generation with seed for testing -- [ ] Default random behavior for production -- [ ] Class documented with XML comments""" - }, - { - "title": "[2pts] Implement player leveling and stat progression", - "labels": "wave-2,difficulty-2", - "body": """## Description -Implement player leveling system with XP thresholds and stat progression. - -**Depends on:** Player class issue - -## Level System -- Define XP thresholds for levels 1-10 -- Example: Level 2 = 100 XP, Level 3 = 250 XP, etc. - -## Level Up Effects -When player levels up: -- Increment Level property -- Increase AttackPower (e.g., +2) -- Increase Defense (e.g., +1) -- Increase MaxHealth (e.g., +10) -- Restore some Health (e.g., 50% of MaxHealth) -- Publish PlayerLevelUpEvent via GameEventSystem - -## Progress Tracking -- GetProgressToNextLevel() method -- Returns double (0.0 - 1.0) representing progress -- Used for UI progress bars - -## Acceptance Criteria -- [ ] XP thresholds defined for levels 1-10 -- [ ] Level up logic implemented in Player.AddExperience() -- [ ] AttackPower increases on level up -- [ ] Defense increases on level up -- [ ] MaxHealth increases on level up -- [ ] Health restored partially on level up -- [ ] PlayerLevelUpEvent published via GameEventSystem -- [ ] GetProgressToNextLevel() method implemented -- [ ] Returns 0.0 - 1.0 progress value -- [ ] Method documented with XML comments""" - } - ] - - for issue in wave2_issues: - if create_issue(issue["title"], issue["labels"], issue["body"]): - issues_created += 1 - else: - issues_failed += 1 - - print() - print("Wave 2 issues completed!") - print() - - # Wave 3 Issues - print("Creating Wave 3 issues...") - - wave3_issues = [ - { - "title": "[3pts] Implement SqliteGameRepository", - "labels": "wave-3,difficulty-3", - "body": """## Description -Implement IGameRepository interface using SQLite database for persistence. - -**Depends on:** IGameRepository interface issue - -## SqliteGameRepository Class -Implements IGameRepository using Microsoft.Data.Sqlite - -## Database Operations - -### SaveGame(GameState state) -- Upserts game save by player name -- Creates tables if they don't exist - -### LoadGame(string playerName) -- Returns GameState if found -- Returns null if not found - -### SaveScore(string playerName, int score) -- Inserts new leaderboard entry -- Includes timestamp - -### GetLeaderboard() -- Returns top 10 scores -- Ordered by score descending -- Includes player name, score, and date - -## Requirements -- Creates database and tables on first run -- Use 'using' statements for connection disposal -- Proper SQL parameterization to prevent injection -- Database file: classcrawler.db - -## Acceptance Criteria -- [ ] SqliteGameRepository class implements IGameRepository -- [ ] Uses Microsoft.Data.Sqlite package -- [ ] Creates database and tables on first run -- [ ] SaveGame(GameState) upserts by player name -- [ ] LoadGame(string playerName) returns GameState or null -- [ ] SaveScore(string playerName, int score) inserts with timestamp -- [ ] GetLeaderboard() returns top 10 scores descending -- [ ] Uses 'using' statements for proper disposal -- [ ] SQL uses parameters (no injection vulnerabilities) -- [ ] Class documented with XML comments""" - }, - { - "title": "[2pts] Add leaderboard feature", - "labels": "wave-3,difficulty-2", - "body": """## Description -Implement score calculation and leaderboard display functionality. - -**Depends on:** SqliteGameRepository issue - -## Score Calculation -Calculate final score based on: -- Enemies defeated (points per enemy) -- Gold collected -- Level reached -- Bonus multipliers for difficulty - -## Leaderboard Display -- Show top 10 scores -- Display: rank, player name, score, date -- Accessible from main menu -- Friendly message if no scores exist - -## Integration -- Save score via IGameRepository.SaveScore() at game end -- Retrieve scores via IGameRepository.GetLeaderboard() - -## Acceptance Criteria -- [ ] Score calculation implemented based on metrics -- [ ] Considers enemies defeated -- [ ] Considers gold collected -- [ ] Considers level reached -- [ ] Score saved via IGameRepository.SaveScore() at game end -- [ ] Leaderboard accessible from main menu -- [ ] Displays top 10 scores -- [ ] Shows rank, name, score, and date -- [ ] Friendly message shown if no scores exist -- [ ] Properly formatted display output""" - }, - { - "title": "[3pts] Build console UI layer", - "labels": "wave-3,difficulty-3", - "body": """## Description -Create console-based user interface for the game. - -**Depends on:** Player, Dungeon, and CombatEngine issues - -## GameUI Class -Static Run() method as entry point - -## Main Menu Options -- New Game -- Load Game -- Leaderboard -- Quit - -## Room View -Display: -- Room name and description -- Available exits -- Enemies present -- Items on ground - -## Player Actions -- Move (north, south, east, west) -- Attack enemy -- Pick up item -- Use item -- View stats/inventory - -## Combat Display -- Show turn-by-turn results -- Display damage dealt -- Show health changes -- Announce winner - -## Game Over Screen -- Display final stats -- Save score to leaderboard -- Option to return to main menu - -## Requirements -- No game logic in UI layer -- Call game methods and display results only -- Clear separation of concerns -- User-friendly prompts and output - -## Acceptance Criteria -- [ ] GameUI class with static Run() entry point -- [ ] Main menu with all options implemented -- [ ] New Game starts new player -- [ ] Load Game retrieves saved game -- [ ] Leaderboard displays top scores -- [ ] Quit exits gracefully -- [ ] Room view shows all required information -- [ ] Player can move between rooms -- [ ] Player can attack enemies -- [ ] Player can pick up items -- [ ] Player can use items -- [ ] Player can view stats -- [ ] Combat output shows turn details -- [ ] Game over screen saves score -- [ ] No game logic in UI - only display -- [ ] User-friendly prompts and formatting""" - }, - { - "title": "[2pts] Write unit tests — combat system", - "labels": "wave-3,difficulty-2", - "body": """## Description -Create comprehensive unit tests for combat system components. - -**Depends on:** ICombatStrategy and CombatEngine issues - -## Test Coverage - -### ICombatStrategy Tests -- Test each strategy (Melee, Magic, Ranged) -- Verify damage calculation formulas -- Test with various attack and defense values -- Test edge cases - -### CombatEngine Tests -- Test RunCombat() method -- Player wins scenario -- Enemy wins scenario -- Verify correct XP returned -- Verify correct Gold returned -- Test turn order (player attacks first) - -## Edge Cases to Cover -- Zero health -- Maximum defense (damage reduction) -- Zero attack power -- Negative values (should not occur) - -## Requirements -- Use xUnit testing framework -- Use seeded Random for deterministic tests -- All tests must pass in CI pipeline -- Good test naming conventions - -## Acceptance Criteria -- [ ] Test class for ICombatStrategy implementations -- [ ] MeleeStrategy damage calculation tested -- [ ] MagicStrategy damage calculation tested -- [ ] RangedStrategy damage calculation tested -- [ ] Test class for CombatEngine -- [ ] Player wins scenario tested -- [ ] Enemy wins scenario tested -- [ ] XP reward calculation tested -- [ ] Gold reward calculation tested -- [ ] Turn order verified -- [ ] Edge cases tested (zero health, max defense, zero attack) -- [ ] Uses seeded Random for deterministic behavior -- [ ] All tests pass in CI -- [ ] Tests follow naming conventions""" - }, - { - "title": "[2pts] Write unit tests — items and inventory", - "labels": "wave-3,difficulty-2", - "body": """## Description -Create comprehensive unit tests for item system and player inventory. - -**Depends on:** Item subclasses and Player issues - -## Test Coverage - -### Item Subclass Tests -- **Weapon.Use()**: Verify damage bonus applied correctly -- **Armor.Use()**: Verify defense bonus applied correctly -- **Potion.Use()**: Verify healing applied correctly -- Potion healing capped at MaxHealth - -### Player Inventory Tests -- AddItem() adds item to inventory -- RemoveItem() removes item from inventory -- UseItem() applies item effect and removes from inventory -- Inventory state changes verified - -### LootResolver Tests -- Test with injected seed for deterministic drops -- Verify drop probability calculations -- Verify Dragon always drops at least one item -- Verify Gold equals GoldReward - -## Requirements -- Use xUnit testing framework -- Use seeded Random for loot tests -- Test edge cases (full health, empty inventory, etc.) -- All tests must pass in CI pipeline - -## Acceptance Criteria -- [ ] Test class for Item subclasses -- [ ] Weapon.Use() damage bonus tested -- [ ] Armor.Use() defense bonus tested -- [ ] Potion.Use() healing tested -- [ ] Potion healing capped at MaxHealth verified -- [ ] Test class for Player inventory operations -- [ ] AddItem() tested -- [ ] RemoveItem() tested -- [ ] UseItem() tested -- [ ] Inventory state changes verified -- [ ] Test class for LootResolver -- [ ] Tested with injected seed -- [ ] Drop probability logic verified -- [ ] Dragon loot guarantee tested -- [ ] Gold amount verification tested -- [ ] All tests pass in CI -- [ ] Tests follow naming conventions""" - } - ] - - for issue in wave3_issues: - if create_issue(issue["title"], issue["labels"], issue["body"]): - issues_created += 1 - else: - issues_failed += 1 - - print() - print("Wave 3 issues completed!") - print() - print("=" * 50) - print(f"Summary: {issues_created} issues created successfully") - if issues_failed > 0: - print(f" {issues_failed} issues failed") - print("=" * 50) - - return 0 if issues_failed == 0 else 1 - -if __name__ == "__main__": - sys.exit(main()) diff --git a/create_issues.sh b/create_issues.sh deleted file mode 100755 index 2d1469b..0000000 --- a/create_issues.sh +++ /dev/null @@ -1,829 +0,0 @@ -#!/bin/bash - -# Script to create GitHub issues for ClassCrawler project -# This script creates all issues across Wave 1, Wave 2, and Wave 3 - -REPO="Merlissa09/ClassCrawler" - -echo "Creating GitHub issues for ClassCrawler..." -echo "==========================================" -echo "" - -# Wave 1 Issues - -echo "Creating Wave 1 issues..." - -gh issue create \ - --repo "$REPO" \ - --title "[2pts] Create Character abstract base class" \ - --label "wave-1,difficulty-2" \ - --body "## Description -Create the abstract Character base class with the following properties and methods. - -## Properties -- Name (string) -- Health (int) -- MaxHealth (int) -- AttackPower (int) -- Defense (int) -- Level (int) -- IsAlive (bool) - -## Methods -- **abstract** TakeDamage(int amount) -- **virtual** GetDescription() - -## Requirements -- Enforce that Health cannot go below 0 -- Implement IsAlive property logic - -## Acceptance Criteria -- [ ] Character abstract class is created with all required properties -- [ ] TakeDamage(int amount) abstract method is declared -- [ ] GetDescription() virtual method is implemented -- [ ] Health property enforces non-negative values (cannot go below 0) -- [ ] IsAlive property correctly reflects whether Health > 0 -- [ ] Class is properly documented with XML comments" - -gh issue create \ - --repo "$REPO" \ - --title "[2pts] Create Item abstract base class and subclasses" \ - --label "wave-1,difficulty-2" \ - --body "## Description -Create an abstract Item base class and concrete subclasses for Weapon, Armor, and Potion. - -## Abstract Item Class Properties -- Name (string) -- Description (string) -- Weight (double) - -## Abstract Item Class Methods -- **abstract** Use(Character target) -- **virtual** GetDescription() - -## Concrete Subclasses - -### Weapon -- DamageBonus (int) -- Override Use() to apply damage bonus -- Override GetDescription() - -### Armor -- DefenseBonus (int) -- Override Use() to apply defense bonus -- Override GetDescription() - -### Potion -- HealAmount (int) -- Override Use() to heal target -- Override GetDescription() - -## Acceptance Criteria -- [ ] Abstract Item base class created with Name, Description, Weight properties -- [ ] Abstract Use(Character target) method declared -- [ ] Virtual GetDescription() method implemented -- [ ] Weapon subclass with DamageBonus property implemented -- [ ] Armor subclass with DefenseBonus property implemented -- [ ] Potion subclass with HealAmount property implemented -- [ ] Each subclass properly overrides Use() method -- [ ] Each subclass properly overrides GetDescription() method -- [ ] All classes documented with XML comments" - -gh issue create \ - --repo "$REPO" \ - --title "[2pts] Create Room and Dungeon classes" \ - --label "wave-1,difficulty-2" \ - --body "## Description -Create Room and Dungeon classes for managing the game world structure. - -## Room Class -### Properties -- Name (string) -- Description (string) -- Enemies (List) -- Items (List) -- IsCleared (bool) -- Exits (Dictionary) - -## Dungeon Class -### Properties -- Rooms (List) -- CurrentRoom (Room) - -### Methods -- MovePlayer(string direction) - moves player to adjacent room -- **static** GenerateDungeon() - creates a 4-room test dungeon - -## Acceptance Criteria -- [ ] Room class created with all required properties -- [ ] Room.Exits dictionary allows connections between rooms -- [ ] Dungeon class created with Rooms and CurrentRoom properties -- [ ] MovePlayer(string direction) method implemented -- [ ] Static GenerateDungeon() method creates a 4-room test dungeon -- [ ] Test dungeon has proper room connections via Exits -- [ ] All classes documented with XML comments" - -gh issue create \ - --repo "$REPO" \ - --title "[1pt] Define IGameRepository interface" \ - --label "wave-1,difficulty-1" \ - --body "## Description -Define the IGameRepository interface and GameState record for game persistence. This is interface and model definition only - no implementation required. - -## IGameRepository Interface Methods -- SaveGame(GameState state) -- LoadGame(string playerName) returns GameState or null -- SaveScore(string playerName, int score) -- GetLeaderboard() returns List - -## GameState Record -A record type with the following properties: -- PlayerName (string) -- Health (int) -- Level (int) -- CurrentRoomName (string) -- Inventory (List) - serialized item names - -## LeaderboardEntry Record (if needed) -- PlayerName (string) -- Score (int) -- Date (DateTime) - -## Acceptance Criteria -- [ ] IGameRepository interface defined with all required methods -- [ ] SaveGame(GameState) method signature declared -- [ ] LoadGame(string playerName) method signature declared -- [ ] SaveScore(string playerName, int score) method signature declared -- [ ] GetLeaderboard() method signature declared -- [ ] GameState record defined with all required properties -- [ ] All interfaces and records documented with XML comments -- [ ] No implementation code - interface definition only" - -gh issue create \ - --repo "$REPO" \ - --title "[2pts] Set up GitHub Actions CI pipeline" \ - --label "wave-1,difficulty-2" \ - --body "## Description -Create a GitHub Actions workflow for continuous integration that builds and tests the project. - -## Workflow Configuration -- File: .github/workflows/ci.yml -- Triggers: push to main branch and all pull requests -- .NET version: 8 - -## Workflow Steps -1. Checkout code -2. Setup .NET 8 -3. Restore dependencies (dotnet restore) -4. Build project (dotnet build) -5. Run tests (dotnet test) - -## Additional Requirements -- Add a passing build badge to README.md -- Badge should link to the workflow runs -- Badge format: ![Build Status](workflow-badge-url) - -## Acceptance Criteria -- [ ] .github/workflows/ci.yml file created -- [ ] Workflow triggers on push to main branch -- [ ] Workflow triggers on all pull requests -- [ ] Checkout step included -- [ ] Setup .NET 8 step included -- [ ] dotnet restore step included -- [ ] dotnet build step included -- [ ] dotnet test step included -- [ ] Build badge added to README.md -- [ ] Badge correctly shows build status -- [ ] Workflow runs successfully on push" - -echo "" -echo "Wave 1 issues created successfully!" -echo "" - -# Wave 2 Issues - -echo "Creating Wave 2 issues..." - -gh issue create \ - --repo "$REPO" \ - --title "[2pts] Implement Player class" \ - --label "wave-2,difficulty-2" \ - --body "## Description -Implement the Player class that inherits from Character base class. - -**Depends on:** Character base class issue - -## Additional Properties -- Inventory (List) -- Experience (int) -- Gold (int) - -## Methods -- AddItem(Item item) -- RemoveItem(Item item) -- UseItem(Item item) -- AddExperience(int amount) -- Override GetDescription() to include inventory summary - -## Requirements -- AddExperience should include a stub for triggering level-up -- Inventory operations should properly manage the item list -- GetDescription should show player stats and inventory summary - -## Acceptance Criteria -- [ ] Player class inherits from Character -- [ ] Inventory property (List) implemented -- [ ] Experience property implemented -- [ ] Gold property implemented -- [ ] AddItem(Item item) method implemented -- [ ] RemoveItem(Item item) method implemented -- [ ] UseItem(Item item) method implemented -- [ ] AddExperience(int amount) method with level-up stub implemented -- [ ] GetDescription() overridden to include inventory summary -- [ ] Class documented with XML comments" - -gh issue create \ - --repo "$REPO" \ - --title "[2pts] Create Enemy abstract class and concrete enemy types" \ - --label "wave-2,difficulty-2" \ - --body "## Description -Create abstract Enemy class and concrete enemy type implementations. - -**Depends on:** Character base class issue - -## Enemy Abstract Class -Inherits from Character and adds: -- ExperienceReward (int) -- GoldReward (int) -- LootTable (List) -- **abstract** GetAttackDescription() method - -## Concrete Enemy Types - -### Goblin -- Low stats (low health, attack, defense) -- Distinct flavor text in GetAttackDescription() - -### Orc -- High health -- Medium attack and defense -- Distinct flavor text in GetAttackDescription() - -### Dragon -- Boss tier stats (very high in all categories) -- Distinct flavor text in GetAttackDescription() - -## Acceptance Criteria -- [ ] Enemy abstract class inherits from Character -- [ ] ExperienceReward property added -- [ ] GoldReward property added -- [ ] LootTable property (List) added -- [ ] Abstract GetAttackDescription() method declared -- [ ] Goblin concrete class implemented with low stats -- [ ] Orc concrete class implemented with high health -- [ ] Dragon concrete class implemented with boss-tier stats -- [ ] Each enemy type has distinct flavor text -- [ ] All classes documented with XML comments" - -gh issue create \ - --repo "$REPO" \ - --title "[3pts] Define ICombatStrategy interface and implement concrete strategies" \ - --label "wave-2,difficulty-3" \ - --body "## Description -Implement the Strategy pattern for combat actions using ICombatStrategy interface. - -**Depends on:** Character base class issue - -## ICombatStrategy Interface -- Execute(Character attacker, Character target) returns CombatResult - -## CombatResult Class -- DamageDealt (int) -- AttackerName (string) -- TargetName (string) -- Message (string) - -## Concrete Strategy Implementations - -### MeleeStrategy -- Direct physical damage calculation -- Uses attacker's AttackPower and target's Defense - -### MagicStrategy -- Magic damage that partially bypasses defense -- Different calculation than melee - -### RangedStrategy -- Ranged attack with different mechanics -- Unique damage calculation - -## Integration -- Add CombatStrategy property to Character base class -- Include code comment explaining Strategy pattern choice - -## Acceptance Criteria -- [ ] ICombatStrategy interface defined with Execute method -- [ ] CombatResult class created with all properties -- [ ] MeleeStrategy implemented -- [ ] MagicStrategy implemented -- [ ] RangedStrategy implemented -- [ ] Character.CombatStrategy property added -- [ ] Each strategy has distinct damage calculation -- [ ] Code comment explaining Strategy pattern included -- [ ] All classes and interfaces documented with XML comments" - -gh issue create \ - --repo "$REPO" \ - --title "[2pts] Implement CharacterFactory" \ - --label "wave-2,difficulty-2" \ - --body "## Description -Implement a Factory pattern for creating Player and Enemy instances with preset configurations. - -**Depends on:** Character and Enemy classes issues - -## CharacterFactory Static Class - -### CreatePlayer(string name, string characterClass) -Supports three character classes: -- **warrior**: High health and defense, MeleeStrategy -- **mage**: High attack power, low defense, MagicStrategy -- **rogue**: Balanced stats, RangedStrategy - -### CreateEnemy(string type, int scalingLevel) -Creates enemies with scaled stats: -- **goblin**: Base stats scaled by level -- **orc**: Base stats scaled by level -- **dragon**: Base stats scaled by level - -## Requirements -- Each character class has distinct stat distributions -- Each gets an appropriate default ICombatStrategy -- Enemy stats scale with level parameter -- Include code comment explaining Factory pattern choice - -## Acceptance Criteria -- [ ] CharacterFactory static class created -- [ ] CreatePlayer(string name, string characterClass) implemented -- [ ] Warrior class configuration with MeleeStrategy -- [ ] Mage class configuration with MagicStrategy -- [ ] Rogue class configuration with RangedStrategy -- [ ] CreateEnemy(string type, int scalingLevel) implemented -- [ ] Goblin creation with stat scaling -- [ ] Orc creation with stat scaling -- [ ] Dragon creation with stat scaling -- [ ] Code comment explaining Factory pattern choice -- [ ] Class documented with XML comments" - -gh issue create \ - --repo "$REPO" \ - --title "[3pts] Implement GameEventSystem using Observer pattern" \ - --label "wave-2,difficulty-3" \ - --body "## Description -Implement an event system using the Observer pattern for game-wide notifications. - -## IGameEventListener Interface -- OnEvent(GameEvent gameEvent) - -## GameEvent Abstract Base Class -- EventType (enum) -- Message (string) -- Timestamp (DateTime) - -## EventType Enum -- PlayerLevelUp -- EnemyDefeated -- ItemPickedUp -- PlayerDeath - -## Concrete Event Classes -- PlayerLevelUpEvent (includes new level) -- EnemyDefeatedEvent (includes enemy name, XP, gold) -- ItemPickedUpEvent (includes item name) -- PlayerDeathEvent (includes cause of death) - -## GameEventSystem Static Class -- Subscribe(IGameEventListener listener) -- Unsubscribe(IGameEventListener listener) -- Publish(GameEvent gameEvent) - -## Demo Implementation -- GameLogger class implements IGameEventListener -- Prints events to console with formatting - -## Requirements -- Include code comment explaining Observer pattern choice -- Thread-safe implementation (not required if single-threaded) - -## Acceptance Criteria -- [ ] IGameEventListener interface defined -- [ ] GameEvent abstract base class created -- [ ] EventType enum defined -- [ ] PlayerLevelUpEvent implemented -- [ ] EnemyDefeatedEvent implemented -- [ ] ItemPickedUpEvent implemented -- [ ] PlayerDeathEvent implemented -- [ ] GameEventSystem static class with Subscribe/Unsubscribe/Publish -- [ ] GameLogger demo listener implemented -- [ ] Code comment explaining Observer pattern choice -- [ ] All classes documented with XML comments" - -gh issue create \ - --repo "$REPO" \ - --title "[3pts] Implement turn-based combat loop" \ - --label "wave-2,difficulty-3" \ - --body "## Description -Implement turn-based combat system with CombatEngine class. - -**Depends on:** Character, Player, Enemy, and ICombatStrategy issues - -## CombatEngine Class - -### RunCombat(Player player, Enemy enemy) -Returns CombatOutcome with: -- Winner (Character) -- TotalDamageDealt (int) -- ExperienceEarned (int) -- GoldEarned (int) -- TurnCount (int) - -## Combat Rules -- Player attacks first each turn -- Each character uses their ICombatStrategy.Execute() -- Combat continues until one character dies (Health <= 0) -- Publishes events via GameEventSystem: - - EnemyDefeatedEvent if player wins - - PlayerDeathEvent if enemy wins - -## Requirements -- No UI/console output in CombatEngine -- Pure game logic only -- Combat result encapsulates all outcome data - -## Acceptance Criteria -- [ ] CombatEngine class created -- [ ] RunCombat(Player player, Enemy enemy) method implemented -- [ ] CombatOutcome class defined with all properties -- [ ] Player attacks first each turn -- [ ] Uses ICombatStrategy.Execute() for attacks -- [ ] Combat continues until one character's Health <= 0 -- [ ] Publishes EnemyDefeatedEvent on enemy death -- [ ] Publishes PlayerDeathEvent on player death -- [ ] Returns complete CombatOutcome -- [ ] No UI logic in class -- [ ] Class documented with XML comments" - -gh issue create \ - --repo "$REPO" \ - --title "[2pts] Implement loot system" \ - --label "wave-2,difficulty-2" \ - --body "## Description -Implement loot generation system with configurable drop rates. - -**Depends on:** Enemy and Item classes issues - -## LootResolver Class - -### ResolveLoot(Enemy enemy) -Returns List based on: -- Enemy's LootTable -- Configurable drop probability per item -- Special rules for boss enemies - -## Loot Rules -- Each item in LootTable has a drop probability (0.0 - 1.0) -- Dragon always drops at least one item -- Gold always equals enemy.GoldReward -- Random seed should be injectable for deterministic testing - -## Requirements -- Constructor accepts optional Random seed for testing -- Default uses unseeded Random for production -- Item drop rates are configurable per item - -## Acceptance Criteria -- [ ] LootResolver class created -- [ ] ResolveLoot(Enemy enemy) method implemented -- [ ] Returns List based on LootTable -- [ ] Supports configurable drop probability per item -- [ ] Dragon always drops at least one item -- [ ] Gold amount equals enemy.GoldReward -- [ ] Constructor accepts optional Random seed -- [ ] Deterministic loot generation with seed for testing -- [ ] Default random behavior for production -- [ ] Class documented with XML comments" - -gh issue create \ - --repo "$REPO" \ - --title "[2pts] Implement player leveling and stat progression" \ - --label "wave-2,difficulty-2" \ - --body "## Description -Implement player leveling system with XP thresholds and stat progression. - -**Depends on:** Player class issue - -## Level System -- Define XP thresholds for levels 1-10 -- Example: Level 2 = 100 XP, Level 3 = 250 XP, etc. - -## Level Up Effects -When player levels up: -- Increment Level property -- Increase AttackPower (e.g., +2) -- Increase Defense (e.g., +1) -- Increase MaxHealth (e.g., +10) -- Restore some Health (e.g., 50% of MaxHealth) -- Publish PlayerLevelUpEvent via GameEventSystem - -## Progress Tracking -- GetProgressToNextLevel() method -- Returns double (0.0 - 1.0) representing progress -- Used for UI progress bars - -## Acceptance Criteria -- [ ] XP thresholds defined for levels 1-10 -- [ ] Level up logic implemented in Player.AddExperience() -- [ ] AttackPower increases on level up -- [ ] Defense increases on level up -- [ ] MaxHealth increases on level up -- [ ] Health restored partially on level up -- [ ] PlayerLevelUpEvent published via GameEventSystem -- [ ] GetProgressToNextLevel() method implemented -- [ ] Returns 0.0 - 1.0 progress value -- [ ] Method documented with XML comments" - -echo "" -echo "Wave 2 issues created successfully!" -echo "" - -# Wave 3 Issues - -echo "Creating Wave 3 issues..." - -gh issue create \ - --repo "$REPO" \ - --title "[3pts] Implement SqliteGameRepository" \ - --label "wave-3,difficulty-3" \ - --body "## Description -Implement IGameRepository interface using SQLite database for persistence. - -**Depends on:** IGameRepository interface issue - -## SqliteGameRepository Class -Implements IGameRepository using Microsoft.Data.Sqlite - -## Database Operations - -### SaveGame(GameState state) -- Upserts game save by player name -- Creates tables if they don't exist - -### LoadGame(string playerName) -- Returns GameState if found -- Returns null if not found - -### SaveScore(string playerName, int score) -- Inserts new leaderboard entry -- Includes timestamp - -### GetLeaderboard() -- Returns top 10 scores -- Ordered by score descending -- Includes player name, score, and date - -## Requirements -- Creates database and tables on first run -- Use 'using' statements for connection disposal -- Proper SQL parameterization to prevent injection -- Database file: classcrawler.db - -## Acceptance Criteria -- [ ] SqliteGameRepository class implements IGameRepository -- [ ] Uses Microsoft.Data.Sqlite package -- [ ] Creates database and tables on first run -- [ ] SaveGame(GameState) upserts by player name -- [ ] LoadGame(string playerName) returns GameState or null -- [ ] SaveScore(string playerName, int score) inserts with timestamp -- [ ] GetLeaderboard() returns top 10 scores descending -- [ ] Uses 'using' statements for proper disposal -- [ ] SQL uses parameters (no injection vulnerabilities) -- [ ] Class documented with XML comments" - -gh issue create \ - --repo "$REPO" \ - --title "[2pts] Add leaderboard feature" \ - --label "wave-3,difficulty-2" \ - --body "## Description -Implement score calculation and leaderboard display functionality. - -**Depends on:** SqliteGameRepository issue - -## Score Calculation -Calculate final score based on: -- Enemies defeated (points per enemy) -- Gold collected -- Level reached -- Bonus multipliers for difficulty - -## Leaderboard Display -- Show top 10 scores -- Display: rank, player name, score, date -- Accessible from main menu -- Friendly message if no scores exist - -## Integration -- Save score via IGameRepository.SaveScore() at game end -- Retrieve scores via IGameRepository.GetLeaderboard() - -## Acceptance Criteria -- [ ] Score calculation implemented based on metrics -- [ ] Considers enemies defeated -- [ ] Considers gold collected -- [ ] Considers level reached -- [ ] Score saved via IGameRepository.SaveScore() at game end -- [ ] Leaderboard accessible from main menu -- [ ] Displays top 10 scores -- [ ] Shows rank, name, score, and date -- [ ] Friendly message shown if no scores exist -- [ ] Properly formatted display output" - -gh issue create \ - --repo "$REPO" \ - --title "[3pts] Build console UI layer" \ - --label "wave-3,difficulty-3" \ - --body "## Description -Create console-based user interface for the game. - -**Depends on:** Player, Dungeon, and CombatEngine issues - -## GameUI Class -Static Run() method as entry point - -## Main Menu Options -- New Game -- Load Game -- Leaderboard -- Quit - -## Room View -Display: -- Room name and description -- Available exits -- Enemies present -- Items on ground - -## Player Actions -- Move (north, south, east, west) -- Attack enemy -- Pick up item -- Use item -- View stats/inventory - -## Combat Display -- Show turn-by-turn results -- Display damage dealt -- Show health changes -- Announce winner - -## Game Over Screen -- Display final stats -- Save score to leaderboard -- Option to return to main menu - -## Requirements -- No game logic in UI layer -- Call game methods and display results only -- Clear separation of concerns -- User-friendly prompts and output - -## Acceptance Criteria -- [ ] GameUI class with static Run() entry point -- [ ] Main menu with all options implemented -- [ ] New Game starts new player -- [ ] Load Game retrieves saved game -- [ ] Leaderboard displays top scores -- [ ] Quit exits gracefully -- [ ] Room view shows all required information -- [ ] Player can move between rooms -- [ ] Player can attack enemies -- [ ] Player can pick up items -- [ ] Player can use items -- [ ] Player can view stats -- [ ] Combat output shows turn details -- [ ] Game over screen saves score -- [ ] No game logic in UI - only display -- [ ] User-friendly prompts and formatting" - -gh issue create \ - --repo "$REPO" \ - --title "[2pts] Write unit tests — combat system" \ - --label "wave-3,difficulty-2" \ - --body "## Description -Create comprehensive unit tests for combat system components. - -**Depends on:** ICombatStrategy and CombatEngine issues - -## Test Coverage - -### ICombatStrategy Tests -- Test each strategy (Melee, Magic, Ranged) -- Verify damage calculation formulas -- Test with various attack and defense values -- Test edge cases - -### CombatEngine Tests -- Test RunCombat() method -- Player wins scenario -- Enemy wins scenario -- Verify correct XP returned -- Verify correct Gold returned -- Test turn order (player attacks first) - -## Edge Cases to Cover -- Zero health -- Maximum defense (damage reduction) -- Zero attack power -- Negative values (should not occur) - -## Requirements -- Use xUnit testing framework -- Use seeded Random for deterministic tests -- All tests must pass in CI pipeline -- Good test naming conventions - -## Acceptance Criteria -- [ ] Test class for ICombatStrategy implementations -- [ ] MeleeStrategy damage calculation tested -- [ ] MagicStrategy damage calculation tested -- [ ] RangedStrategy damage calculation tested -- [ ] Test class for CombatEngine -- [ ] Player wins scenario tested -- [ ] Enemy wins scenario tested -- [ ] XP reward calculation tested -- [ ] Gold reward calculation tested -- [ ] Turn order verified -- [ ] Edge cases tested (zero health, max defense, zero attack) -- [ ] Uses seeded Random for deterministic behavior -- [ ] All tests pass in CI -- [ ] Tests follow naming conventions" - -gh issue create \ - --repo "$REPO" \ - --title "[2pts] Write unit tests — items and inventory" \ - --label "wave-3,difficulty-2" \ - --body "## Description -Create comprehensive unit tests for item system and player inventory. - -**Depends on:** Item subclasses and Player issues - -## Test Coverage - -### Item Subclass Tests -- **Weapon.Use()**: Verify damage bonus applied correctly -- **Armor.Use()**: Verify defense bonus applied correctly -- **Potion.Use()**: Verify healing applied correctly -- Potion healing capped at MaxHealth - -### Player Inventory Tests -- AddItem() adds item to inventory -- RemoveItem() removes item from inventory -- UseItem() applies item effect and removes from inventory -- Inventory state changes verified - -### LootResolver Tests -- Test with injected seed for deterministic drops -- Verify drop probability calculations -- Verify Dragon always drops at least one item -- Verify Gold equals GoldReward - -## Requirements -- Use xUnit testing framework -- Use seeded Random for loot tests -- Test edge cases (full health, empty inventory, etc.) -- All tests must pass in CI pipeline - -## Acceptance Criteria -- [ ] Test class for Item subclasses -- [ ] Weapon.Use() damage bonus tested -- [ ] Armor.Use() defense bonus tested -- [ ] Potion.Use() healing tested -- [ ] Potion healing capped at MaxHealth verified -- [ ] Test class for Player inventory operations -- [ ] AddItem() tested -- [ ] RemoveItem() tested -- [ ] UseItem() tested -- [ ] Inventory state changes verified -- [ ] Test class for LootResolver -- [ ] Tested with injected seed -- [ ] Drop probability logic verified -- [ ] Dragon loot guarantee tested -- [ ] Gold amount verification tested -- [ ] All tests pass in CI -- [ ] Tests follow naming conventions" - -echo "" -echo "Wave 3 issues created successfully!" -echo "" -echo "==========================================" -echo "All GitHub issues created successfully!" -echo "Total: 18 issues (5 Wave 1, 8 Wave 2, 5 Wave 3)" -echo "==========================================" diff --git a/create_single_issue.sh b/create_single_issue.sh deleted file mode 100755 index e88bebb..0000000 --- a/create_single_issue.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# Helper script to create a single issue using GitHub REST API - -TITLE="$1" -LABELS="$2" -BODY="$3" -REPO="Merlissa09/ClassCrawler" - -# Create JSON payload -JSON_PAYLOAD=$(jq -n \ - --arg title "$TITLE" \ - --arg body "$BODY" \ - --arg labels "$LABELS" \ - '{ - title: $title, - body: $body, - labels: ($labels | split(",")) - }') - -# Create issue using GitHub API -RESPONSE=$(curl -s -w "\nHTTP_STATUS:%{http_code}" \ - -X POST \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Content-Type: application/json" \ - -d "$JSON_PAYLOAD" \ - "https://api.github.com/repos/$REPO/issues") - -# Extract status code -HTTP_STATUS=$(echo "$RESPONSE" | grep "HTTP_STATUS:" | cut -d: -f2) -BODY_RESPONSE=$(echo "$RESPONSE" | sed '/HTTP_STATUS:/d') - -if [ "$HTTP_STATUS" = "201" ]; then - echo "✓ Successfully created: $TITLE" - echo "$BODY_RESPONSE" | jq -r '.html_url' - exit 0 -else - echo "✗ Failed to create: $TITLE" - echo "Status: $HTTP_STATUS" - echo "$BODY_RESPONSE" | jq -r '.message // .' - exit 1 -fi diff --git a/issues_wave1.json b/issues_wave1.json deleted file mode 100644 index 7192217..0000000 --- a/issues_wave1.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "issues": [ - { - "wave": 1, - "title": "[2pts] Create Character abstract base class", - "labels": ["wave-1", "difficulty-2"], - "body": "## Description\nCreate the abstract Character base class with the following properties and methods.\n\n## Properties\n- Name (string)\n- Health (int)\n- MaxHealth (int)\n- AttackPower (int)\n- Defense (int)\n- Level (int)\n- IsAlive (bool)\n\n## Methods\n- **abstract** TakeDamage(int amount)\n- **virtual** GetDescription()\n\n## Requirements\n- Enforce that Health cannot go below 0\n- Implement IsAlive property logic\n\n## Acceptance Criteria\n- [ ] Character abstract class is created with all required properties\n- [ ] TakeDamage(int amount) abstract method is declared\n- [ ] GetDescription() virtual method is implemented\n- [ ] Health property enforces non-negative values (cannot go below 0)\n- [ ] IsAlive property correctly reflects whether Health > 0\n- [ ] Class is properly documented with XML comments" - }, - { - "wave": 1, - "title": "[2pts] Create Item abstract base class and subclasses", - "labels": ["wave-1", "difficulty-2"], - "body": "## Description\nCreate an abstract Item base class and concrete subclasses for Weapon, Armor, and Potion.\n\n## Abstract Item Class Properties\n- Name (string)\n- Description (string)\n- Weight (double)\n\n## Abstract Item Class Methods\n- **abstract** Use(Character target)\n- **virtual** GetDescription()\n\n## Concrete Subclasses\n\n### Weapon\n- DamageBonus (int)\n- Override Use() to apply damage bonus\n- Override GetDescription()\n\n### Armor\n- DefenseBonus (int)\n- Override Use() to apply defense bonus\n- Override GetDescription()\n\n### Potion\n- HealAmount (int)\n- Override Use() to heal target\n- Override GetDescription()\n\n## Acceptance Criteria\n- [ ] Abstract Item base class created with Name, Description, Weight properties\n- [ ] Abstract Use(Character target) method declared\n- [ ] Virtual GetDescription() method implemented\n- [ ] Weapon subclass with DamageBonus property implemented\n- [ ] Armor subclass with DefenseBonus property implemented\n- [ ] Potion subclass with HealAmount property implemented\n- [ ] Each subclass properly overrides Use() method\n- [ ] Each subclass properly overrides GetDescription() method\n- [ ] All classes documented with XML comments" - }, - { - "wave": 1, - "title": "[2pts] Create Room and Dungeon classes", - "labels": ["wave-1", "difficulty-2"], - "body": "## Description\nCreate Room and Dungeon classes for managing the game world structure.\n\n## Room Class\n### Properties\n- Name (string)\n- Description (string)\n- Enemies (List)\n- Items (List)\n- IsCleared (bool)\n- Exits (Dictionary)\n\n## Dungeon Class\n### Properties\n- Rooms (List)\n- CurrentRoom (Room)\n\n### Methods\n- MovePlayer(string direction) - moves player to adjacent room\n- **static** GenerateDungeon() - creates a 4-room test dungeon\n\n## Acceptance Criteria\n- [ ] Room class created with all required properties\n- [ ] Room.Exits dictionary allows connections between rooms\n- [ ] Dungeon class created with Rooms and CurrentRoom properties\n- [ ] MovePlayer(string direction) method implemented\n- [ ] Static GenerateDungeon() method creates a 4-room test dungeon\n- [ ] Test dungeon has proper room connections via Exits\n- [ ] All classes documented with XML comments" - }, - { - "wave": 1, - "title": "[1pt] Define IGameRepository interface", - "labels": ["wave-1", "difficulty-1"], - "body": "## Description\nDefine the IGameRepository interface and GameState record for game persistence. This is interface and model definition only - no implementation required.\n\n## IGameRepository Interface Methods\n- SaveGame(GameState state)\n- LoadGame(string playerName) returns GameState or null\n- SaveScore(string playerName, int score)\n- GetLeaderboard() returns List\n\n## GameState Record\nA record type with the following properties:\n- PlayerName (string)\n- Health (int)\n- Level (int)\n- CurrentRoomName (string)\n- Inventory (List) - serialized item names\n\n## LeaderboardEntry Record (if needed)\n- PlayerName (string)\n- Score (int)\n- Date (DateTime)\n\n## Acceptance Criteria\n- [ ] IGameRepository interface defined with all required methods\n- [ ] SaveGame(GameState) method signature declared\n- [ ] LoadGame(string playerName) method signature declared\n- [ ] SaveScore(string playerName, int score) method signature declared\n- [ ] GetLeaderboard() method signature declared\n- [ ] GameState record defined with all required properties\n- [ ] All interfaces and records documented with XML comments\n- [ ] No implementation code - interface definition only" - }, - { - "wave": 1, - "title": "[2pts] Set up GitHub Actions CI pipeline", - "labels": ["wave-1", "difficulty-2"], - "body": "## Description\nCreate a GitHub Actions workflow for continuous integration that builds and tests the project.\n\n## Workflow Configuration\n- File: .github/workflows/ci.yml\n- Triggers: push to main branch and all pull requests\n- .NET version: 8\n\n## Workflow Steps\n1. Checkout code\n2. Setup .NET 8\n3. Restore dependencies (dotnet restore)\n4. Build project (dotnet build)\n5. Run tests (dotnet test)\n\n## Additional Requirements\n- Add a passing build badge to README.md\n- Badge should link to the workflow runs\n- Badge format: ![Build Status](workflow-badge-url)\n\n## Acceptance Criteria\n- [ ] .github/workflows/ci.yml file created\n- [ ] Workflow triggers on push to main branch\n- [ ] Workflow triggers on all pull requests\n- [ ] Checkout step included\n- [ ] Setup .NET 8 step included\n- [ ] dotnet restore step included\n- [ ] dotnet build step included\n- [ ] dotnet test step included\n- [ ] Build badge added to README.md\n- [ ] Badge correctly shows build status\n- [ ] Workflow runs successfully on push" - } - ] -}