Skip to content

🧩 Rules — Abstractions

📦 Folder Overview

This folder defines rule-adjacent extension seams used by the Rules layer.


🎯 Purpose

Expose small, focused interfaces that rules can depend on without coupling to concrete implementations.

These are:

  • Lightweight
  • Injectable
  • Safe to use across systems

🧩 What Lives Here

Damage-side

  • IAttackerDamageModifier

  • Provides attacker-side multiplier contributions


Healing-side

  • IHealingModifier

  • Provides healing multiplier contributions

Notes:

  • Values are typically combined multiplicatively
  • Convention:

  • 0 → blocks healing

  • 1 → no change
  • >1 → increases healing

Utility

  • IRng

  • Minimal RNG surface for deterministic or injectable randomness


⚠️ Important Notes

Constraints

Interfaces in this folder are expected to be:

  • Small
  • Stable
  • Stateless or safely stateful
  • Designed to avoid allocations where possible

Boundaries

Do not include:

  • Concrete rule implementations
  • Gameplay logic
  • Health ownership or mutation logic

This folder defines contracts only, not behaviour.


🧠 Usage Guidance

  • Use these interfaces as capability seams for rules
  • Keep implementations focused and isolated
  • Avoid coupling rules to concrete systems

  • Rules
  • Contracts
  • Health System