hero.actions.play #
fn new_player #
fn new_player(actor string, return_format ReturnFormat) !Player
new_player creates a new Player instance
enum ReturnFormat #
enum ReturnFormat {
heroscript
json
}
ReturnFormat defines the format for returning results
struct Player #
@[heap]
struct Player {
pub mut:
actor string // The name of the actor as used in heroscript
return_format ReturnFormat // Format for returning results
session_state SessionState // Session state for database operations
job_db JobDB // Job database handler
}
Player is the main struct for processing heroscript actions
fn (Player) create #
fn (mut p Player) create(params paramsparser.Params) !
create processes a job creation action
fn (Player) delete #
fn (mut p Player) delete(params paramsparser.Params) !
delete processes a job deletion action
fn (Player) get #
fn (mut p Player) get(params paramsparser.Params) !
get processes a job retrieval action
fn (Player) list #
fn (mut p Player) list(params paramsparser.Params) !
list processes a job listing action
fn (Player) play #
fn (mut p Player) play(input string, is_text bool) !
play processes a heroscript text or playbook
fn (Player) update_status #
fn (mut p Player) update_status(params paramsparser.Params) !
update_status processes a job status update action