The following diagram illustrates the core class hierarchy of Pixel Dungeon, including game structure, actors, items, and level generation systems.
classDiagram
%% 기본 UI 레이아웃 (C1)
class PixelScene {
+Camera uiCamera
+float minZoom
+float maxZoom
+void create()
+void destroy()
+void onBackPressed()
+void update()
}
class GameScene {
-SkinnedBlock water
-DungeonTilemap tiles
-FogOfWar fog
-HeroSprite hero
-Group terrain
-Group customTiles
-Group mobs
-Group heaps
-Group effects
+void create()
+void update()
+void onBackPressed()
+void cellClicked(int cell)
}
class Group {
+ArrayList~Gizmo~ members
+void add(Gizmo g)
+void remove(Gizmo g)
+void update()
+void draw()
}
class Camera {
+float zoom
+PointF scroll
+void update()
+void center(float x, float y)
}
PixelScene <|-- GameScene
GameScene --> Group : contains
PixelScene --> Camera : uses
%% 플레이어 상태 표시 UI (C2)
class StatusPane {
-Image avatar
-HealthIndicator health
-BuffIndicator buffs
-Resource gold
-Resource energy
-Button btnInventory
+void layout()
+void update()
}
class HealthIndicator {
-float health
-float shield
+void update()
+void level(float value)
+void health(float value)
}
class BuffIndicator {
-ArrayList~BuffIcon~ buffIcons
+void update()
+void addBuff(Buff buff)
+void removeBuff(Buff buff)
}
StatusPane --> HealthIndicator : contains
StatusPane --> BuffIndicator : contains
%% 인벤토리 UI (C3)
class WndBag {
+Mode mode
+Listener listener
+ArrayList~Item~ items
+void updateItems()
+void onItemClick(Item item)
+enum Mode
}
class InventoryPane {
-ArrayList~ItemSlot~ slots
+void update()
+void layout()
+void onItemClick(Item item)
}
class ItemSlot {
-Item item
-ItemSprite sprite
+void update()
+void item(Item item)
+void enable(boolean value)
}
WndBag --> ItemSlot : contains
InventoryPane --> ItemSlot : contains
%% 전투 피드백 UI (C4)
class FloatingText {
+void show(float x, float y, String text, int color)
+void update()
}
class CharSprite {
+void showStatus(int color, String text)
+void showAlert(String text)
+void blood(int from)
+void die()
}
class EmoIcon {
+Type type
+void update()
+enum Type
}
CharSprite --> FloatingText : uses
CharSprite --> EmoIcon : contains
%% 아이템 정보 UI (C5)
class WndInfoItem {
-ItemSprite image
-RenderedTextBlock titleText
-RenderedTextBlock descText
+void onBackPressed()
}
class ItemSprite {
-Item item
-Glowing glowing
+void view(Item item)
+void update()
}
class Tooltip {
+String text
+void update()
+void show(String text, int color)
}
WndInfoItem --> ItemSprite : contains
ItemSprite --> Tooltip : uses
%% 맵/미니맵 UI (C6)
class Compass {
+void update()
+void visible(boolean value)
}
%% 메뉴 및 설정 UI (C7)
class WndGame {
+void createButtons()
+void onBackPressed()
}
class WndSettings {
+void createControls()
+void onBackPressed()
}
class MenuPane {
-Button btnMenu
-Button btnSettings
-Button btnInfo
+void layout()
+void update()
}
MenuPane --> WndGame : opens
MenuPane --> WndSettings : opens
%% 몬스터, 아이템, 장비, 보스 (C8-C11)
class Mob {
+int EXP
+int defenseSkill
+boolean hostile
+CharSprite sprite
+boolean act()
+int attackSkill(Char target)
+int damageRoll()
+void die(Object cause)
}
class Item {
+String name
+String desc
+int image
+int quantity
+boolean unique
+void execute(Hero hero, String action)
+ArrayList~String~ actions(Hero hero)
+String info()
}
class EquipableItem {
+boolean isEquipped(Hero hero)
+boolean doEquip(Hero hero)
+boolean doUnequip(Hero hero)
}
class MeleeWeapon {
+int tier
+int min()
+int max()
+int damageRoll(Char owner)
+float accuracyFactor(Char owner)
+float speedFactor(Char owner)
}
class Armor {
+int tier
+int DRMin()
+int DRMax()
+int DRRoll()
+int defenseProc(Char attacker, Char defender, int damage)
}
class Boss {
+int defenseSkill
+int damageRoll()
+void damage(int dmg, Object src)
+void die(Object cause)
+void notice()
}
Item <|-- EquipableItem
EquipableItem <|-- MeleeWeapon
EquipableItem <|-- Armor
Mob <|-- Boss
%% 상점 UI 및 시스템 (C12)
class ShopRoom {
+void paint(Level level)
-void placeShopkeeper(Level level)
-void placeItems(Level level)
}
class Shopkeeper {
+void interact(Hero hero)
+boolean act()
}
class WndTradeItem {
-ItemSprite itemSprite
-int price
+void sell()
+void buy()
}
ShopRoom --> Shopkeeper : places
Shopkeeper --> WndTradeItem : opens
%% 게임 튜토리얼 (C13)
class WndStory {
+void tell(String text)
+void onBackPressed()
}
class Banner {
+BannerSprites type
+void show(BannerSprites type)
+void update()
}
class Guidebook {
+void execute(Hero hero, String action)
+String info()
}
Item <|-- Guidebook