Skip to content

Commit

Permalink
Add data-scoped getters for Services
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoLuis0 authored and coelckers committed Feb 19, 2023
1 parent 590475a commit d6e72b5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions wadsrc/static/zscript/engine/service.zs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,27 @@ class Service abstract
{
return null;
}

// data/clearscope variants
virtual clearscope String GetStringData(String request, string stringArg = "", int intArg = 0, double doubleArg = 0, Object objectArg = null)
{
return "";
}

virtual clearscope int GetIntData(String request, string stringArg = "", int intArg = 0, double doubleArg = 0, Object objectArg = null)
{
return 0;
}

virtual clearscope double GetDoubleData(String request, string stringArg = "", int intArg = 0, double doubleArg = 0, Object objectArg = null)
{
return 0.0;
}

virtual clearscope Object GetObjectData(String request, string stringArg = "", int intArg = 0, double doubleArg = 0, Object objectArg = null)
{
return null;
}

static Service Find(class<Service> serviceName){
return AllServices.GetIfExists(serviceName.GetClassName());
Expand Down

0 comments on commit d6e72b5

Please sign in to comment.