Dynamic Turn System

tun system demo gif
Techs Demonstrated
  • C#
  • Unity
  • Git
Project Summary

This tool was built to provide a means of managing turns easily for later turn-based applications. It allows any class to subscribe to the turn system (that implements the defined interfaces), and it also supports adding/removing entities while active.

How: The core idea is simple-- repeatedly go through a list of tasks until the maximum turn-count is reached. The tasks are grouped into turn phases, which can be tailored to suit the project, and the tasks themselves may be added and removed at anytime (the system monitors and performs add/remove commands in real time. Tasks may even be added to a phase that's active). For further details, visit the source code! ^_^


Features

Real-Time Turn Management

The core functionality is present. The system waits for each task to complete before rolling phases, and once each phase has passed then the system rolls the turn over. There is built-in support for reseting data in tasks if a task must perform repeatedly across a number of turns, and tasks may be add and removed from the system while the system is either active or stopped. There is also support for system-wide interruptions.

Regenerate onTurnPass Example

A prebuilt script is included to help understand how to build other utilities. This script runs a "Regenerate Attributes" command on any existing classes (that exist on this gameObject instance) that've implemented the IRegeneratable interface during the refresh phase of the turn system.