@@ -96,10 +96,10 @@ public static CollectionValue Insert(CollectionValue collection, Value value)
9696 }
9797
9898 throw new CustomScriptRuntimeError (
99- $ "Inserted value '{ value } ' has to be the same type as the collection ({ FriendlyName ( type ) } )."
99+ $ "Inserted value '{ value } ' has to be the same type as the collection ({ GetFriendlyName ( type ) } )."
100100 ) ;
101101 }
102- public CollectionValue Insert ( Value val ) => CollectionValue . Insert ( this , val ) ;
102+ public CollectionValue Insert ( Value val ) => Insert ( this , val ) ;
103103
104104 /// <summary>
105105 /// Removes every match if <paramref name="amountToRemove"/> is -1
@@ -113,7 +113,7 @@ public static CollectionValue Remove(CollectionValue collection, Value value, in
113113
114114 if ( type . IsInstanceOfType ( value ) )
115115 {
116- throw new CustomScriptRuntimeError ( $ "Value { value . FriendlyName ( ) } has to be the same type as the collection ({ FriendlyName ( type ) } ).") ;
116+ throw new CustomScriptRuntimeError ( $ "Value { value . FriendlyName } has to be the same type as the collection ({ GetFriendlyName ( type ) } ).") ;
117117 }
118118
119119 var values = collection . CastedValues . ToList ( ) ;
@@ -129,16 +129,16 @@ public static CollectionValue Remove(CollectionValue collection, Value value, in
129129
130130 return new CollectionValue ( values ) ;
131131 }
132- public CollectionValue Remove ( Value val , int amountToRemove = - 1 ) => CollectionValue . Remove ( this , val , amountToRemove ) ;
132+ public CollectionValue Remove ( Value val , int amountToRemove = - 1 ) => Remove ( this , val , amountToRemove ) ;
133133
134134 public static CollectionValue RemoveAt ( CollectionValue collection , int index )
135135 {
136136 return new CollectionValue ( collection . CastedValues . Where ( ( _ , i ) => i != index - 1 ) ) ;
137137 }
138- public CollectionValue RemoveAt ( int index ) => CollectionValue . RemoveAt ( this , index ) ;
138+ public CollectionValue RemoveAt ( int index ) => RemoveAt ( this , index ) ;
139139
140140 public static bool Contains ( CollectionValue collection , Value value ) => collection . CastedValues . Contains ( value ) ;
141- public bool Contains ( Value val ) => CollectionValue . Contains ( this , val ) ;
141+ public bool Contains ( Value val ) => Contains ( this , val ) ;
142142
143143 public static CollectionValue operator + ( CollectionValue lhs , CollectionValue rhs )
144144 {
@@ -166,6 +166,8 @@ public static CollectionValue RemoveAt(CollectionValue collection, int index)
166166 return new CollectionValue ( lhs . CastedValues . Where ( val => ! rhs . CastedValues . Contains ( val ) ) ) ;
167167 }
168168
169+ public override string FriendlyName => "collection value" ;
170+
169171 public override string ToString ( )
170172 {
171173 return $ "[{ string . Join ( ", " , CastedValues . Select ( v => v . ToString ( ) ) ) } ]";
0 commit comments