12 private readonly Dictionary<int, BadInterfacePrototype>
s_GenericCache =
new Dictionary<int, BadInterfacePrototype>();
21 public bool IsGeneric => GenericParameters.Count != 0;
49 string[] genericParameters) : base(
59 GenericName = $
"{name}<{string.Join(",
", genericParameters)}>";
79 string[] genericParameters,
81 string genericName) : base(
122 return GenericParameters.Count != 0 && proto is
BadInterfacePrototype iProto && iProto.m_GenericDefinition ==
this ||
132 return IsResolved ? $
"interface {GenericName}" : $
"interface {Name}<{string.Join(",
", GenericParameters)}>";
133 return $
"interface {Name}";
147 int hash = args[0].GetHashCode();
149 for(
int i = 1; i < args.Length; i++)
151 hash = (hash * 397) ^ args[i].GetHashCode();
161 $
"{Name}<{string.Join(",
", types.Select(x=> x is IBadGenericObject g ? g.GenericName : x.Name))}>");
The Execution Context. Every execution of a script needs a context the script is running in....
BadScope Scope
The Root Scope of the Context.
Gets thrown by the runtime.
static BadRuntimeException Create(BadScope? scope, string message)
Creates a new BadScriptException.
The Base Class for all BadScript Objects.
Implements a Class Prototype for the BadScript Language.
IReadOnlyCollection< BadInterfacePrototype > Interfaces
The Implemented Interfaces.
string Name
The Name of the Type.
readonly BadMetaData MetaData
The Metadata of the Class.
Implements a Native Class Prototype.
Implements an Interface Constraint.
Implements a BadScript Interface Prototype.
BadInterfacePrototype(string name, Func< BadObject[], BadInterfacePrototype[]> interfaces, BadMetaData? metaData, Func< BadObject[], BadInterfaceConstraint[]> constraints, string[] genericParameters, BadInterfacePrototype genericDefinition, string genericName)
Creates a new Interface Prototype.
bool IsResolved
Indicates if the Object was already resolved to a concrete type.
static readonly BadClassPrototype s_Prototype
The Prototype for the Interface Prototype.
override? BadClassPrototype BaseClass
BadObject CreateGeneric(BadObject[] args)
Resolves the Generic Object to a concrete type.
override IEnumerable< BadObject > CreateInstance(BadExecutionContext caller, bool setThis=true)
string GenericName
The Generic Name of the Object.
override string ToSafeString(List< BadObject > done)
override bool IsSuperClassOf(BadClassPrototype proto)
Returns true if the Class is a Subclass of the given Class.true if the Class is a Subclass of the giv...
BadInterfacePrototype(string name, Func< BadObject[], BadInterfacePrototype[]> interfaces, BadMetaData? metaData, Func< BadObject[], BadInterfaceConstraint[]> constraints, string[] genericParameters)
Creates a new Interface Prototype.
IEnumerable< BadInterfaceConstraint > Constraints
The Constraints of this Interface.
override BadClassPrototype GetPrototype()
readonly Func< BadObject[], BadInterfacePrototype[]> m_InterfacesFunc
IReadOnlyCollection< string > GenericParameters
The Generic Parameters of the Object.
readonly? BadInterfacePrototype m_GenericDefinition
readonly Func< BadObject[], BadInterfaceConstraint[]> m_ConstraintsFunc
Backing Function of the Constraints Property.
override IReadOnlyCollection< BadInterfacePrototype > Interfaces
BadInterfaceConstraint?[] m_Constraints
The Constraints of this Interface.
bool IsGeneric
Indicates if the Object is a Generic Object.
BadInterfacePrototype?[] m_Interfaces
readonly Dictionary< int, BadInterfacePrototype > s_GenericCache
Represents a Generic Object.
Contains the Parser for the BadScript2 Language.
Contains the Reader Tokens for the BadScript2 Language.
Contains the Error Objects for the BadScript2 Language.
Contains Runtime Interface Objects.