public override Value Invoke( List Arguments ) { var list = Arguments.GetValues(); if ( list[ 0 ] is Function ) onLoad = list[ 0 ] as Function; if ( list[ 1 ] is Function ) onUpdate = list[ 1 ] as Function; Firefly.Initialize( 800, 500, "Firefly Window", LoadEventInterface, true ); return this; }
public Value Min(List Arguments) { if (Arguments.GetValues().All(X => X is Number)) { return(Arguments.Arr.Min()); } throw new Exception("Min function can only be used on arrays containing only numbers"); }
public Value Output(List Arguments) { foreach (var val in Arguments.GetValues()) { Console.Write(val); } Console.WriteLine(); return(NoValue.Value); }
public Value Output( List Arguments ) { foreach ( var val in Arguments.GetValues() ) { Console.Write( val ); } Console.WriteLine(); return NoValue.Value; }
public override Value Invoke( List Arguments ) { var list = Arguments.GetValues(); if ( list[ 0 ] is Boolean ) { var temp = new List<float>(); for ( int i = 1 ; i < list.Count ; ++i ) { if ( list[ i ] is Number ) temp.Add( (float)( (Number)list[ i ] ).Val ); } Polygon = new Polygon( ( (Boolean)list[ 0 ] ).Val, temp.ToArray() ); } else throw new Exception( "First argument of the polygon constructor must be a boolean" ); return this; }
public override Value Invoke(List Arguments) { var list = Arguments.GetValues(); if (list[0] is Function) { onLoad = list[0] as Function; } if (list[1] is Function) { onUpdate = list[1] as Function; } Firefly.Initialize(800, 500, "Firefly Window", LoadEventInterface, true); return(this); }
public override Value Invoke(List Arguments) { if (Arguments.Arr.Count == 3) { var list = Arguments.GetValues(); Value first = list[0], second = list[1], third = list[2]; if (first is Number && second is Number && third is Number) { red = first as Number; green = second as Number; blue = third as Number; return(this); } } throw new Exception("Color constructor takes 3 numbers"); }
public override Value Invoke( List Arguments ) { if ( Arguments.Arr.Count == 3 ) { var list = Arguments.GetValues(); Value first = list[ 0 ], second = list[ 1 ], third = list[ 2 ]; if ( first is Number && second is Number && third is Number ) { red = first as Number; green = second as Number; blue = third as Number; return this; } } throw new Exception( "Color constructor takes 3 numbers" ); }
public override Value Invoke(List Arguments) { dimensions = new List <int>(); foreach (var dimension in Arguments.GetValues()) { if (dimension is Number) { dimensions.Add((int)((dimension as Number).Val)); } else { throw new Exception("Array constructor takes only numbers"); } } var toReturn = MakeArray(0); Arr = toReturn; return(this); }
public override Value Invoke(List Arguments) { var list = Arguments.GetValues(); if (list[0] is Boolean) { var temp = new List <float>(); for (int i = 1; i < list.Count; ++i) { if (list[i] is Number) { temp.Add((float)((Number)list[i]).Val); } } Polygon = new Polygon(((Boolean)list[0]).Val, temp.ToArray()); } else { throw new Exception("First argument of the polygon constructor must be a boolean"); } return(this); }
public Function(List Arguments, CodeBlock Code, Scope Scope) : this(Arguments.GetValues().ConvertAll(X => X as String), Code.Value, Scope) { }