How thelegendseb/xapps works
Project Type and Purpose
• XApps is a .NET extension framework (delivered as a DLL) that abstracts a WinForms application into a dynamic, tick-driven graphics and input system.
Key Architectural Components
a. Host Application (WinForms)
• Provides UI surface (Form) and event loop.
• Instantiates and drives XApp.
b. Core Framework (src/Base + src/BaseExtensions)
• XApp – entry point, ties into WinForms Form, spawns XSession.
• XBase – base class for any managed object (renderers, physics, UI elements).
c. Graphics Subsystem (src/Graphics)
• Animation & AnimationCollection – timeline‐based motion helpers.
• ControlExtensions (e.g., Slider) – prebuilt UI widgets rendered on the graphics surface.
d. SideClasses Modules (src/SideClasses)
– Networking: XNetServer, XNetNode, XNetTransmitter for building networked applications.
– Other helpers: XInput, XMath, APIManager, Vector – general utilities for any .NET project.
Interactions and Data Flow
• The Host Application (Form) → creates an instance of XApp → passes itself (the Form) to XApp constructor.
• The user adds XBase subclasses (e.g., TimeDisplay, custom renderers) to XSession.
• XSession’s game loop (on each tick) → iterates over active XBase instances →
• calls Update(session) if Update flag is set
• SideClasses modules can be injected into XBase subclasses for 3D computations or for network messaging.
Architectural Patterns and Principles
• Component-Based Design: XBase acts as a component that can be extended or composed into larger objects.
• Modularity: Core framework is decoupled from SideClasses modules; both are consumer–provider boundaries via interfaces/base classes.
• Rectangle: Host WinForms Form (entry point)
• Rectangle: XApp → XSession
• SideClasses (3D, Networking, Extensions) in another (e.g., green)
• Host Application and external services in neutral gray
d. Labels and Notations:
• Tick rate (e.g., 60 fps) on the XSession loop
• Optional extension points (SetSpeed, SetClearColor, AddObj, QueueRelease)