How ahin99/oop_hw2 works
Character OOP Visualizer is a client-side Next.js app for exploring class inheritance and character behavior. Users choose a class in the inheritance panel, create characters, then manage them on a board: attack with an item, level up, or delete. The page owns character and code-view state, invokes the attack rules, and supplies generated snippets and outcomes to the code panel. The README also documents class defaults, polymorphic special-item attacks, and UML viewing. Edges reflect shown callbacks and imports; unsampled board and modal wiring is omitted where the excerpts do not establish it.
Main entry points: page.tsx App workflow · characterRules.ts Character rules · ProfileAvatar.tsx Profile avatar · CreateCharacterModal.tsx Create modal
Components 15
Character interface
- App workflow
app/page.tsx - Inheritance panel
components/InheritancePanel.tsx - Character board
components/CharacterBoard.tsx - Character card
components/CharacterCard.tsx - Create modal
components/CreateCharacterModal.tsx - Attack modal
components/AttackModal.tsx - Level-up modal
components/LevelUpModal.tsx - Delete modal
components/DeleteCharacterModal.tsx - Profile avatar
components/ProfileAvatar.tsx - UML diagram
public/uml-diagram.pdf
Character behavior
- Character rules
lib/characterRules.ts - Domain types
lib/types.ts
Execution explanation
- Code snippets
lib/codeSnippets.ts - Code viewer
components/CodeViewer.tsx
Other components
- User
Connections 28
- User → App workflow: uses
README.md - App workflow → Inheritance panel: renders
app/page.tsx - App workflow → Character board: renders
app/page.tsx - App workflow → Code viewer: renders
app/page.tsx - App workflow → Attack modal: renders
app/page.tsx - App workflow → Create modal: renders
app/page.tsx - App workflow → Level-up modal: renders
app/page.tsx - App workflow → Delete modal: renders
app/page.tsx - App workflow → Character rules: calculates attacks
app/page.tsx - App workflow → Code snippets: builds code view
app/page.tsx - Inheritance panel → App workflow: requests creation
components/InheritancePanel.tsx - Inheritance panel → UML diagram: embeds diagram
components/InheritancePanel.tsx - Character board → Character card: renders
components/CharacterBoard.tsx - Character card → Profile avatar: renders
components/CharacterCard.tsx - Create modal → Profile avatar: renders
components/CreateCharacterModal.tsx - Attack modal → Profile avatar: renders
components/AttackModal.tsx - Level-up modal → Profile avatar: renders
components/LevelUpModal.tsx - Delete modal → Profile avatar: renders
components/DeleteCharacterModal.tsx - Attack modal → App workflow: submits attack
components/AttackModal.tsx - Level-up modal → App workflow: submits level-up
components/LevelUpModal.tsx - Delete modal → App workflow: confirms deletion
app/page.tsx - Create modal → App workflow: submits character
components/CreateCharacterModal.tsx - Attack modal → Character rules: uses item options
components/AttackModal.tsx - Create modal → Character rules: uses defaults
components/CreateCharacterModal.tsx - App workflow → Code viewer: passes view state
app/page.tsx - Character rules → Code snippets: provides class defaults
lib/codeSnippets.ts - Code viewer → Domain types: reads view type
components/CodeViewer.tsx - Character rules → Domain types: uses domain types
lib/characterRules.ts