Skip to content

[2pts] Implement CharacterFactory #11

@github-actions

Description

@github-actions

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions