GetValues() public method

public GetValues ( ) : List
return List
Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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");
 }
Ejemplo n.º 3
0
 public Value Output(List Arguments)
 {
     foreach (var val in Arguments.GetValues())
     {
         Console.Write(val);
     }
     Console.WriteLine();
     return(NoValue.Value);
 }
Ejemplo n.º 4
0
 public Value Output( List Arguments )
 {
     foreach ( var val in Arguments.GetValues() )
     {
         Console.Write( val );
     }
     Console.WriteLine();
     return NoValue.Value;
 }
Ejemplo n.º 5
0
        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;
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
 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");
 }
Ejemplo n.º 8
0
 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" );
 }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
 public Function(List Arguments, CodeBlock Code, Scope Scope)
     : this(Arguments.GetValues().ConvertAll(X => X as String), Code.Value, Scope)
 {
 }