28 new Dictionary<int, BadInterfacePrototype>();
48 string[] genericParameters) : base(name,
58 GenericName = $
"{name}<{string.Join(",
", genericParameters)}>";
77 string[] genericParameters,
79 string genericName) : base(name,
97 public override IReadOnlyCollection<BadInterfacePrototype>
Interfaces =>
106#region IBadGenericObject Members
137 for (
int i = 1; i < args.Length; i++)
139 hash = (hash * 397) ^
158 $
"{Name}<{string.Join(",
", types.Select(x => x is IBadGenericObject g ? g.GenericName : x.Name))}>"
185 base.IsSuperClassOf(proto) ||
196 ? $
"interface {GenericName}"
197 : $
"interface {Name}<{string.Join(",
", GenericParameters)}>";
200 return $
"interface {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 Error Objects for the BadScript2 Language.
Contains Runtime Interface Objects.