Beispiel #1
0
        public override object __hx_invoke1_o(double __fn_float1, object __fn_dyn1)
        {
                        #line 142 "/my-component/src/englishauction/AuctionRepository.hx"
            global::maglev.MagLevAny   ret = (((__fn_dyn1 == global::haxe.lang.Runtime.undefined)) ? (((global::maglev.MagLevAny)(((object)(__fn_float1))))) : (((global::maglev.MagLevAny)(__fn_dyn1))));
            global::maglev.MagLevArray arr = ((global::maglev.MagLevArray)(this.res.getResult()));
                        #line 144 "/my-component/src/englishauction/AuctionRepository.hx"
            int i = 0;
            while ((i < arr.size()))
            {
                                #line 146 "/my-component/src/englishauction/AuctionRepository.hx"
                global::englishauction.AuctionModel model  = new global::englishauction.AuctionModel();
                global::maglev.MagLevObject         resobj = ((global::maglev.MagLevObject)(arr.@get(i)));
                                #line 148 "/my-component/src/englishauction/AuctionRepository.hx"
                model.id    = (((global::maglev.MagLevString)(resobj.@get("auctionId")))).getString();
                model.start = (((global::maglev.MagLevNumber)(resobj.@get("start")))).getInt();
                                #line 150 "/my-component/src/englishauction/AuctionRepository.hx"
                model.end           = (((global::maglev.MagLevNumber)(resobj.@get("end")))).getInt();
                model.startingPrice = (((global::maglev.MagLevNumber)(resobj.@get("startingPrice")))).getFloat();
                                #line 152 "/my-component/src/englishauction/AuctionRepository.hx"
                model.reservePrice   = (((global::maglev.MagLevNumber)(resobj.@get("reservePrice")))).getFloat();
                model.priceIncrement = (((global::maglev.MagLevNumber)(resobj.@get("priceIncrement")))).getFloat();
                                #line 154 "/my-component/src/englishauction/AuctionRepository.hx"
                this.auctions.push(model);
                ++i;
            }

                        #line 157 "/my-component/src/englishauction/AuctionRepository.hx"
            this.callback.__hx_invoke1_o(default(double), this.auctions);
            return(global::maglev.MagLevResult.fromResult(global::maglev.MagLevNull.create()));
        }
 public override object __hx_invoke1_o(double __fn_float1, object __fn_dyn1)
 {
     unchecked {
                         #line 45 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
         global::maglev.MagLevArray args = (((__fn_dyn1 == global::haxe.lang.Runtime.undefined)) ? (((global::maglev.MagLevArray)(((object)(__fn_float1))))) : (((global::maglev.MagLevArray)(__fn_dyn1))));
         double monthlyPayment           = (((global::maglev.MagLevNumber)(args.@get(0)))).getFloat();
                         #line 47 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
         double tradeInAllowance   = (((global::maglev.MagLevNumber)(args.@get(1)))).getFloat();
         double tradeInLoanBalance = (((global::maglev.MagLevNumber)(args.@get(2)))).getFloat();
                         #line 49 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
         double downPaymentAndRebates = (((global::maglev.MagLevNumber)(args.@get(3)))).getFloat();
         double loanDuration          = (((global::maglev.MagLevNumber)(args.@get(4)))).getFloat();
                         #line 51 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
         double salesTaxRate = (((global::maglev.MagLevNumber)(args.@get(5)))).getFloat();
         double interestRate = (((global::maglev.MagLevNumber)(args.@get(6)))).getFloat();
                         #line 53 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
         object result = this._gthis.calc.calcAffordability(monthlyPayment, tradeInAllowance, tradeInLoanBalance, downPaymentAndRebates, loanDuration, salesTaxRate, interestRate);
                         #line 60 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
         global::maglev.MagLevObject obj = global::maglev.MagLevObject.create();
         obj.@set("price", global::maglev.MagLevNumber.fromFloat(global::haxe.lang.Runtime.getField_f(result, "price", 1217089161, true)));
                         #line 62 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
         obj.@set("tax", global::maglev.MagLevNumber.fromFloat(global::haxe.lang.Runtime.getField_f(result, "tax", 5790315, true)));
         obj.@set("interest", global::maglev.MagLevNumber.fromFloat(global::haxe.lang.Runtime.getField_f(result, "interest", 678404778, true)));
                         #line 64 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
         obj.@set("total", global::maglev.MagLevNumber.fromFloat(global::haxe.lang.Runtime.getField_f(result, "total", 338842564, true)));
         return(global::maglev.MagLevResult.fromResult(obj));
     }
                 #line default
 }
Beispiel #3
0
 public override object __hx_invoke1_o(double __fn_float1, object __fn_dyn1)
 {
     unchecked {
                         #line 43 "/my-component/src/financecalculator/FinanceCalculator.hx"
         global::maglev.MagLevArray args = (((__fn_dyn1 == global::haxe.lang.Runtime.undefined)) ? (((global::maglev.MagLevArray)(((object)(__fn_float1))))) : (((global::maglev.MagLevArray)(__fn_dyn1))));
         double presentValue             = (((global::maglev.MagLevNumber)(args.@get(0)))).getFloat();
                         #line 45 "/my-component/src/financecalculator/FinanceCalculator.hx"
         int    numPeriods   = (((global::maglev.MagLevNumber)(args.@get(1)))).getInt();
         double interestRate = (((global::maglev.MagLevNumber)(args.@get(2)))).getFloat();
                         #line 47 "/my-component/src/financecalculator/FinanceCalculator.hx"
         int    timesCompoundedPerPeriod = (((global::maglev.MagLevNumber)(args.@get(3)))).getInt();
         double depositAmount            = (((global::maglev.MagLevNumber)(args.@get(4)))).getFloat();
                         #line 49 "/my-component/src/financecalculator/FinanceCalculator.hx"
         bool   depositAtBeginning = (((global::maglev.MagLevBoolean)(args.@get(5)))).getBool();
         object ret = this._gthis.calc.futureValue(presentValue, numPeriods, interestRate, timesCompoundedPerPeriod, depositAmount, depositAtBeginning);
                         #line 51 "/my-component/src/financecalculator/FinanceCalculator.hx"
         global::maglev.MagLevObject resobj = global::maglev.MagLevObject.create();
         resobj.@set("futureValue", global::maglev.MagLevNumber.fromFloat(global::haxe.lang.Runtime.getField_f(ret, "futureValue", 530154542, true)));
                         #line 53 "/my-component/src/financecalculator/FinanceCalculator.hx"
         resobj.@set("totalInterest", global::maglev.MagLevNumber.fromFloat(global::haxe.lang.Runtime.getField_f(ret, "totalInterest", 1580406414, true)));
         global::maglev.MagLevResult result = global::maglev.MagLevResult.fromResult(resobj);
                         #line 55 "/my-component/src/financecalculator/FinanceCalculator.hx"
         return(result);
     }
                 #line default
 }
Beispiel #4
0
        public override object __hx_invoke1_o(double __fn_float1, object __fn_dyn1)
        {
                        #line 46 "/my-component/src/shoppingcart/ShoppingCart.hx"
            global::Array <object>     items = (((__fn_dyn1 == global::haxe.lang.Runtime.undefined)) ? (((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(((object)(__fn_float1)))))))) : (((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(__fn_dyn1)))))));
            global::maglev.MagLevArray arr   = global::maglev.MagLevArray.create();
                        #line 48 "/my-component/src/shoppingcart/ShoppingCart.hx"
            {
                                #line 48 "/my-component/src/shoppingcart/ShoppingCart.hx"
                int _g = 0;
                                #line 48 "/my-component/src/shoppingcart/ShoppingCart.hx"
                while ((_g < items.length))
                {
                                        #line 48 "/my-component/src/shoppingcart/ShoppingCart.hx"
                    object item = items[_g];
                                        #line 48 "/my-component/src/shoppingcart/ShoppingCart.hx"
                    ++_g;
                    global::maglev.MagLevObject obj = global::maglev.MagLevObject.create();
                                        #line 50 "/my-component/src/shoppingcart/ShoppingCart.hx"
                    obj.@set("idx", global::maglev.MagLevNumber.fromInt(((int)(global::haxe.lang.Runtime.getField_f(item, "idx", 5243965, true)))));
                    obj.@set("itemId", global::maglev.MagLevString.fromString(global::haxe.lang.Runtime.toString(global::haxe.lang.Runtime.getField(item, "itemId", 151629774, true))));
                                        #line 52 "/my-component/src/shoppingcart/ShoppingCart.hx"
                    obj.@set("qty", global::maglev.MagLevNumber.fromFloat(global::haxe.lang.Runtime.getField_f(item, "qty", 5645366, true)));
                    obj.@set("price", global::maglev.MagLevNumber.fromFloat(global::haxe.lang.Runtime.getField_f(item, "price", 1217089161, true)));
                                        #line 54 "/my-component/src/shoppingcart/ShoppingCart.hx"
                    arr.push(obj);
                }
            }

                        #line 56 "/my-component/src/shoppingcart/ShoppingCart.hx"
            this.result.setResult(arr);
                        #line 46 "/my-component/src/shoppingcart/ShoppingCart.hx"
            return(null);
        }
Beispiel #5
0
        public override object __hx_invoke1_o(double __fn_float1, object __fn_dyn1)
        {
                        #line 47 "/my-component/src/englishauction/AuctionRepository.hx"
            global::maglev.MagLevAny ret = (((__fn_dyn1 == global::haxe.lang.Runtime.undefined)) ? (((global::maglev.MagLevAny)(((object)(__fn_float1))))) : (((global::maglev.MagLevAny)(__fn_dyn1))));
            if (global::Std.isOfType(((object)(this.res.getResult())), ((object)(typeof(global::maglev.MagLevNull)))))
            {
                                #line 49 "/my-component/src/englishauction/AuctionRepository.hx"
                this.callback.__hx_invoke1_o(default(double), null);
            }

                        #line 51 "/my-component/src/englishauction/AuctionRepository.hx"
            global::maglev.MagLevObject         resobj = ((global::maglev.MagLevObject)(this.res.getResult()));
            global::englishauction.AuctionModel model  = new global::englishauction.AuctionModel();
                        #line 53 "/my-component/src/englishauction/AuctionRepository.hx"
            model.id    = (((global::maglev.MagLevString)(resobj.@get("auctionId")))).getString();
            model.start = (((global::maglev.MagLevNumber)(resobj.@get("start")))).getInt();
                        #line 55 "/my-component/src/englishauction/AuctionRepository.hx"
            model.end           = (((global::maglev.MagLevNumber)(resobj.@get("end")))).getInt();
            model.startingPrice = (((global::maglev.MagLevNumber)(resobj.@get("startingPrice")))).getFloat();
                        #line 57 "/my-component/src/englishauction/AuctionRepository.hx"
            model.reservePrice   = (((global::maglev.MagLevNumber)(resobj.@get("reservePrice")))).getFloat();
            model.priceIncrement = (((global::maglev.MagLevNumber)(resobj.@get("priceIncrement")))).getFloat();
                        #line 59 "/my-component/src/englishauction/AuctionRepository.hx"
            this.callback.__hx_invoke1_o(default(double), model);
            return(global::maglev.MagLevResult.fromResult(global::maglev.MagLevNull.create()));
        }
Beispiel #6
0
 public override object __hx_invoke1_o(double __fn_float1, object __fn_dyn1)
 {
                 #line 90 "/my-component/src/shoppingcart/ShoppingCart.hx"
     object summary = (((__fn_dyn1 == global::haxe.lang.Runtime.undefined)) ? (((object)(__fn_float1))) : (((object)(__fn_dyn1))));
     global::maglev.MagLevObject obj = global::maglev.MagLevObject.create();
                 #line 92 "/my-component/src/shoppingcart/ShoppingCart.hx"
     obj.@set("items", global::maglev.MagLevNumber.fromInt(((int)(global::haxe.lang.Runtime.getField_f(summary, "items", 1108126720, true)))));
     obj.@set("total", global::maglev.MagLevNumber.fromFloat(global::haxe.lang.Runtime.getField_f(summary, "total", 338842564, true)));
                 #line 94 "/my-component/src/shoppingcart/ShoppingCart.hx"
     this.result.setResult(obj);
                 #line 90 "/my-component/src/shoppingcart/ShoppingCart.hx"
     return(null);
 }
 public virtual void Add(global::englishauction.BidModel bid, global::haxe.lang.Function callback)
 {
                 #line 14 "/my-component/src/englishauction/BidRepository.hx"
     global::maglev.MagLevObject data = global::maglev.MagLevObject.create();
     data.@set("auctionId", global::maglev.MagLevString.fromString(bid.auctionId));
                 #line 16 "/my-component/src/englishauction/BidRepository.hx"
     data.@set("userId", global::maglev.MagLevString.fromString(bid.userId));
     data.@set("price", global::maglev.MagLevNumber.fromFloat(bid.price));
                 #line 18 "/my-component/src/englishauction/BidRepository.hx"
     global::maglev.MagLevArray args = global::maglev.MagLevArray.create();
     args.push(data);
                 #line 20 "/my-component/src/englishauction/BidRepository.hx"
     global::maglev.MagLevResult res = this.bus.call("Persistence.EnglishAuction.Bid.New", args);
     res.onResult(new global::englishauction.BidRepository_Add_21__Fun(callback));
                 #line 25 "/my-component/src/englishauction/BidRepository.hx"
     res.onError((((global::englishauction.BidRepository_Add_25__Fun.__hx_current != null)) ? (global::englishauction.BidRepository_Add_25__Fun.__hx_current) : (global::englishauction.BidRepository_Add_25__Fun.__hx_current = ((global::englishauction.BidRepository_Add_25__Fun)(new global::englishauction.BidRepository_Add_25__Fun())))));
 }
        public override object __hx_invoke1_o(double __fn_float1, object __fn_dyn1)
        {
            unchecked {
                                #line 20 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                global::maglev.MagLevArray args = (((__fn_dyn1 == global::haxe.lang.Runtime.undefined)) ? (((global::maglev.MagLevArray)(((object)(__fn_float1))))) : (((global::maglev.MagLevArray)(__fn_dyn1))));
                double newCarPrice = (((global::maglev.MagLevNumber)(args.@get(0)))).getFloat();
                                #line 22 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                double tradeInAllowance   = (((global::maglev.MagLevNumber)(args.@get(1)))).getFloat();
                double tradeInLoanBalance = (((global::maglev.MagLevNumber)(args.@get(2)))).getFloat();
                                #line 24 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                double downPaymentAndRebates = (((global::maglev.MagLevNumber)(args.@get(3)))).getFloat();
                double loanDuration          = (((global::maglev.MagLevNumber)(args.@get(4)))).getFloat();
                                #line 26 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                double salesTaxRate = (((global::maglev.MagLevNumber)(args.@get(5)))).getFloat();
                double interestRate = (((global::maglev.MagLevNumber)(args.@get(6)))).getFloat();
                                #line 28 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                global::Array <object> payments = this._gthis.calc.calcPayments(newCarPrice, tradeInAllowance, tradeInLoanBalance, downPaymentAndRebates, loanDuration, salesTaxRate, interestRate);
                                #line 35 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                global::maglev.MagLevArray arr = global::maglev.MagLevArray.create();
                {
                                        #line 36 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                    int _g = 0;
                                        #line 36 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                    while ((_g < payments.length))
                    {
                                                #line 36 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                        object payment = payments[_g];
                                                #line 36 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                        ++_g;
                        global::maglev.MagLevObject obj = global::maglev.MagLevObject.create();
                                                #line 38 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                        obj.@set("frequency", global::maglev.MagLevString.fromString(global::haxe.lang.Runtime.toString(global::haxe.lang.Runtime.getField(payment, "frequency", 1005224604, true))));
                        obj.@set("payment", global::maglev.MagLevNumber.fromFloat(global::haxe.lang.Runtime.getField_f(payment, "payment", 1842834182, true)));
                                                #line 40 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                        obj.@set("interest", global::maglev.MagLevNumber.fromFloat(global::haxe.lang.Runtime.getField_f(payment, "interest", 678404778, true)));
                        arr.push(obj);
                    }
                }

                                #line 43 "/my-component/src/carloancalculator/CarLoanCalculator.hx"
                return(global::maglev.MagLevResult.fromResult(arr));
            }
                        #line default
        }
Beispiel #9
0
 public virtual void Add(global::englishauction.AuctionModel auction, global::haxe.lang.Function callback)
 {
                 #line 14 "/my-component/src/englishauction/AuctionRepository.hx"
     global::maglev.MagLevObject obj = global::maglev.MagLevObject.create();
     obj.@set("start", global::maglev.MagLevNumber.fromInt(auction.start));
                 #line 16 "/my-component/src/englishauction/AuctionRepository.hx"
     obj.@set("end", global::maglev.MagLevNumber.fromInt(auction.end));
     obj.@set("startingPrice", global::maglev.MagLevNumber.fromFloat(auction.startingPrice));
                 #line 18 "/my-component/src/englishauction/AuctionRepository.hx"
     obj.@set("reservePrice", global::maglev.MagLevNumber.fromFloat(auction.reservePrice));
     obj.@set("priceIncrement", global::maglev.MagLevNumber.fromFloat(auction.priceIncrement));
                 #line 20 "/my-component/src/englishauction/AuctionRepository.hx"
     global::maglev.MagLevArray args = global::maglev.MagLevArray.create();
     args.push(obj);
                 #line 22 "/my-component/src/englishauction/AuctionRepository.hx"
     global::maglev.MagLevResult res = this.bus.call("Persistence.EnglishAuction.Auction.CreateNew", args);
     res.onResult(new global::englishauction.AuctionRepository_Add_23__Fun(callback));
                 #line 27 "/my-component/src/englishauction/AuctionRepository.hx"
     res.onError((((global::englishauction.AuctionRepository_Add_27__Fun.__hx_current != null)) ? (global::englishauction.AuctionRepository_Add_27__Fun.__hx_current) : (global::englishauction.AuctionRepository_Add_27__Fun.__hx_current = ((global::englishauction.AuctionRepository_Add_27__Fun)(new global::englishauction.AuctionRepository_Add_27__Fun())))));
 }
        public override object __hx_invoke1_o(double __fn_float1, object __fn_dyn1)
        {
                        #line 65 "/my-component/src/englishauction/BidRepository.hx"
            global::maglev.MagLevAny   onres = (((__fn_dyn1 == global::haxe.lang.Runtime.undefined)) ? (((global::maglev.MagLevAny)(((object)(__fn_float1))))) : (((global::maglev.MagLevAny)(__fn_dyn1))));
            global::maglev.MagLevArray arr   = ((global::maglev.MagLevArray)(onres));
                        #line 67 "/my-component/src/englishauction/BidRepository.hx"
            global::Array <object> bids = new global::Array <object>();
            int i = 0;
                        #line 69 "/my-component/src/englishauction/BidRepository.hx"
            while ((i < arr.size()))
            {
                                #line 70 "/my-component/src/englishauction/BidRepository.hx"
                global::englishauction.BidModel model  = new global::englishauction.BidModel();
                global::maglev.MagLevObject     resobj = ((global::maglev.MagLevObject)(arr.@get(i)));
                                #line 72 "/my-component/src/englishauction/BidRepository.hx"
                model.id = (((global::maglev.MagLevString)(resobj.@get("bidId")))).getString();
                if (resobj.exists("auctionId"))
                {
                                        #line 74 "/my-component/src/englishauction/BidRepository.hx"
                    model.auctionId = (((global::maglev.MagLevString)(resobj.@get("auctionId")))).getString();
                }
                else
                {
                                        #line 76 "/my-component/src/englishauction/BidRepository.hx"
                    model.auctionId = this.auctionId;
                }

                                #line 78 "/my-component/src/englishauction/BidRepository.hx"
                model.userId = (((global::maglev.MagLevString)(resobj.@get("userId")))).getString();
                model.price  = (((global::maglev.MagLevNumber)(resobj.@get("price")))).getFloat();
                                #line 80 "/my-component/src/englishauction/BidRepository.hx"
                bids.push(model);
                ++i;
            }

                        #line 83 "/my-component/src/englishauction/BidRepository.hx"
            this.callback.__hx_invoke1_o(default(double), bids);
            return(global::maglev.MagLevResult.fromResult(global::maglev.MagLevNull.create()));
        }
        public static object convertToHaxe(global::maglev.MagLevAny x)
        {
                        #line 16 "/my-component/src/persistence/MagLevConverter.hx"
            if ((x.getType() == global::maglev.MagLevNull.getStaticType()))
            {
                                #line 17 "/my-component/src/persistence/MagLevConverter.hx"
                return(null);
            }
            else if ((x.getType() == global::maglev.MagLevBoolean.getStaticType()))
            {
                                #line 20 "/my-component/src/persistence/MagLevConverter.hx"
                global::maglev.MagLevBoolean y = ((global::maglev.MagLevBoolean)(x));
                return((object)(y.getBool()));
            }
            else if ((x.getType() == global::maglev.MagLevString.getStaticType()))
            {
                                #line 24 "/my-component/src/persistence/MagLevConverter.hx"
                global::maglev.MagLevString y1 = ((global::maglev.MagLevString)(x));
                return((object)(y1.getString()));
            }
            else if ((x.getType() == global::maglev.MagLevNumber.getStaticType()))
            {
                                #line 28 "/my-component/src/persistence/MagLevConverter.hx"
                global::maglev.MagLevNumber y2 = ((global::maglev.MagLevNumber)(x));
                return((object)(y2.getFloat()));
            }
            else if ((x.getType() == global::maglev.MagLevArray.getStaticType()))
            {
                                #line 32 "/my-component/src/persistence/MagLevConverter.hx"
                global::maglev.MagLevArray y3  = ((global::maglev.MagLevArray)(x));
                global::Array <object>     arr = new global::Array <object>();
                                #line 34 "/my-component/src/persistence/MagLevConverter.hx"
                int i = 0;
                while ((i < y3.size()))
                {
                                        #line 36 "/my-component/src/persistence/MagLevConverter.hx"
                    arr.push(global::persistence.MagLevConverter.convertToHaxe(y3.@get(i)));
                    ++i;
                }

                                #line 39 "/my-component/src/persistence/MagLevConverter.hx"
                return((object)(arr));
            }
            else if ((x.getType() == global::maglev.MagLevObject.getStaticType()))
            {
                                #line 42 "/my-component/src/persistence/MagLevConverter.hx"
                global::maglev.MagLevObject        y4  = ((global::maglev.MagLevObject)(x));
                global::haxe.ds.StringMap <object> map = new global::haxe.ds.StringMap <object>();
                                #line 44 "/my-component/src/persistence/MagLevConverter.hx"
                global::maglev.MagLevArray keys = y4.keys();
                int i1 = 0;
                                #line 46 "/my-component/src/persistence/MagLevConverter.hx"
                while ((i1 < keys.size()))
                {
                                        #line 47 "/my-component/src/persistence/MagLevConverter.hx"
                    string key = (((global::maglev.MagLevString)(keys.@get(i1)))).getString();
                    map.@set(key, global::persistence.MagLevConverter.convertToHaxe(y4.@get(key)));
                                        #line 49 "/my-component/src/persistence/MagLevConverter.hx"
                    ++i1;
                }

                                #line 51 "/my-component/src/persistence/MagLevConverter.hx"
                return((object)(map));
            }
            else if ((x.getType() == global::maglev.MagLevFunction.getStaticType()))
            {
                                #line 54 "/my-component/src/persistence/MagLevConverter.hx"
                global::maglev.MagLevFunction y5 = ((global::maglev.MagLevFunction)(x));
                global::haxe.lang.Function    f  = new global::persistence.MagLevConverter_convertToHaxe_55__Fun(y5);
                                #line 69 "/my-component/src/persistence/MagLevConverter.hx"
                return((object)(f));
            }
            else
            {
                                #line 72 "/my-component/src/persistence/MagLevConverter.hx"
                throw ((global::System.Exception)(global::haxe.Exception.thrown("convertToHaxe: unknown type")));
            }
        }
        public static global::maglev.MagLevAny convertToMagLev(object x)
        {
                        #line 77 "/my-component/src/persistence/MagLevConverter.hx"
            if ((x == null))
            {
                                #line 78 "/my-component/src/persistence/MagLevConverter.hx"
                return(global::maglev.MagLevNull.create());
            }
            else if (global::Std.isOfType(((object)(x)), ((object)(typeof(bool)))))
            {
                                #line 81 "/my-component/src/persistence/MagLevConverter.hx"
                return(global::maglev.MagLevBoolean.fromBool(global::haxe.lang.Runtime.toBool(x)));
            }
            else if (global::Std.isOfType(((object)(x)), ((object)(typeof(string)))))
            {
                                #line 84 "/my-component/src/persistence/MagLevConverter.hx"
                return(global::maglev.MagLevString.fromString(global::haxe.lang.Runtime.toString(x)));
            }
            else if (global::Std.isOfType(((object)(x)), ((object)(typeof(int)))))
            {
                                #line 87 "/my-component/src/persistence/MagLevConverter.hx"
                return(global::maglev.MagLevNumber.fromInt(((int)(global::haxe.lang.Runtime.toInt(x)))));
            }
            else if (global::Std.isOfType(((object)(x)), ((object)(typeof(double)))))
            {
                                #line 90 "/my-component/src/persistence/MagLevConverter.hx"
                return(global::maglev.MagLevNumber.fromFloat(((double)(global::haxe.lang.Runtime.toDouble(((object)(x)))))));
            }
            else if ((((object)(x)) is global::haxe.lang.Function))
            {
                                #line 93 "/my-component/src/persistence/MagLevConverter.hx"
                global::haxe.lang.Function f = new global::persistence.MagLevConverter_convertToMagLev_93__Fun(x);
                                #line 103 "/my-component/src/persistence/MagLevConverter.hx"
                return(global::maglev.MagLevFunction.fromFunction(f));
            }
            else if (global::Std.isOfType(((object)(x)), ((object)(typeof(global::Array <object>)))))
            {
                                #line 106 "/my-component/src/persistence/MagLevConverter.hx"
                global::maglev.MagLevArray arr = global::maglev.MagLevArray.create();
                global::Array <object>     y   = ((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(((object)(x)))))));
                                #line 108 "/my-component/src/persistence/MagLevConverter.hx"
                {
                                        #line 108 "/my-component/src/persistence/MagLevConverter.hx"
                    int _g = 0;
                                        #line 108 "/my-component/src/persistence/MagLevConverter.hx"
                    while ((_g < y.length))
                    {
                                                #line 108 "/my-component/src/persistence/MagLevConverter.hx"
                        object item = y[_g];
                                                #line 108 "/my-component/src/persistence/MagLevConverter.hx"
                        ++_g;
                        arr.push(global::persistence.MagLevConverter.convertToMagLev(item));
                    }
                }

                                #line 111 "/my-component/src/persistence/MagLevConverter.hx"
                return(arr);
            }
            else if (global::Std.isOfType(((object)(x)), ((object)(typeof(global::haxe.ds.StringMap <object>)))))
            {
                                #line 114 "/my-component/src/persistence/MagLevConverter.hx"
                global::haxe.ds.StringMap <object> map = ((global::haxe.ds.StringMap <object>)(global::haxe.ds.StringMap <object> .__hx_cast <object>(((global::haxe.ds.StringMap)(((object)(x)))))));
                global::maglev.MagLevObject        obj = global::maglev.MagLevObject.create();
                                #line 116 "/my-component/src/persistence/MagLevConverter.hx"
                {
                                        #line 116 "/my-component/src/persistence/MagLevConverter.hx"
                    object key = ((object)(new global::haxe.ds._StringMap.StringMapKeyIterator <object>(((global::haxe.ds.StringMap <object>)(map)))));
                                        #line 116 "/my-component/src/persistence/MagLevConverter.hx"
                    while (global::haxe.lang.Runtime.toBool(global::haxe.lang.Runtime.callField(key, "hasNext", 407283053, null)))
                    {
                                                #line 116 "/my-component/src/persistence/MagLevConverter.hx"
                        string key1 = global::haxe.lang.Runtime.toString(global::haxe.lang.Runtime.callField(key, "next", 1224901875, null));
                        obj.@set(key1, global::persistence.MagLevConverter.convertToMagLev((map.@get(key1)).toDynamic()));
                    }
                }

                                #line 119 "/my-component/src/persistence/MagLevConverter.hx"
                return(obj);
            }
            else if (global::Reflect.isObject(x))
            {
                                #line 122 "/my-component/src/persistence/MagLevConverter.hx"
                global::maglev.MagLevObject obj1 = global::maglev.MagLevObject.create();
                {
                                        #line 123 "/my-component/src/persistence/MagLevConverter.hx"
                    int _g1 = 0;
                                        #line 123 "/my-component/src/persistence/MagLevConverter.hx"
                    global::Array <string> _g2 = global::Reflect.fields(x);
                                        #line 123 "/my-component/src/persistence/MagLevConverter.hx"
                    while ((_g1 < _g2.length))
                    {
                                                #line 123 "/my-component/src/persistence/MagLevConverter.hx"
                        string field = _g2[_g1];
                                                #line 123 "/my-component/src/persistence/MagLevConverter.hx"
                        ++_g1;
                        object val = global::Reflect.getProperty(x, field);
                                                #line 125 "/my-component/src/persistence/MagLevConverter.hx"
                        obj1.@set(field, global::persistence.MagLevConverter.convertToMagLev(val));
                    }
                }

                                #line 127 "/my-component/src/persistence/MagLevConverter.hx"
                return(obj1);
            }
            else
            {
                                #line 130 "/my-component/src/persistence/MagLevConverter.hx"
                throw ((global::System.Exception)(global::haxe.Exception.thrown("convertToMagLev: unknown type")));
            }
        }
Beispiel #13
0
        public virtual object convertToHaxe(global::maglev.MagLevAny x)
        {
                        #line 107 "/my-component/src/maglev/MagLevCs.hx"
            if ((x.getType() == global::maglev.MagLevNull.getStaticType()))
            {
                                #line 108 "/my-component/src/maglev/MagLevCs.hx"
                return(null);
            }
            else if ((x.getType() == global::maglev.MagLevBoolean.getStaticType()))
            {
                                #line 111 "/my-component/src/maglev/MagLevCs.hx"
                global::maglev.MagLevBoolean y = ((global::maglev.MagLevBoolean)(x));
                return((object)(y.getBool()));
            }
            else if ((x.getType() == global::maglev.MagLevString.getStaticType()))
            {
                                #line 115 "/my-component/src/maglev/MagLevCs.hx"
                global::maglev.MagLevString y1 = ((global::maglev.MagLevString)(x));
                return((object)(y1.getString()));
            }
            else if ((x.getType() == global::maglev.MagLevNumber.getStaticType()))
            {
                                #line 119 "/my-component/src/maglev/MagLevCs.hx"
                global::maglev.MagLevNumber y2 = ((global::maglev.MagLevNumber)(x));
                return((object)(y2.getFloat()));
            }
            else if ((x.getType() == global::maglev.MagLevArray.getStaticType()))
            {
                                #line 123 "/my-component/src/maglev/MagLevCs.hx"
                global::maglev.MagLevArray y3  = ((global::maglev.MagLevArray)(x));
                global::Array <object>     arr = new global::Array <object>();
                                #line 125 "/my-component/src/maglev/MagLevCs.hx"
                int i = 0;
                while ((i < y3.size()))
                {
                                        #line 127 "/my-component/src/maglev/MagLevCs.hx"
                    arr.push(this.convertToHaxe(y3.@get(i)));
                    ++i;
                }

                                #line 130 "/my-component/src/maglev/MagLevCs.hx"
                return((object)(arr));
            }
            else if ((x.getType() == global::maglev.MagLevObject.getStaticType()))
            {
                                #line 133 "/my-component/src/maglev/MagLevCs.hx"
                global::maglev.MagLevObject        y4  = ((global::maglev.MagLevObject)(x));
                global::haxe.ds.StringMap <object> map = new global::haxe.ds.StringMap <object>();
                                #line 135 "/my-component/src/maglev/MagLevCs.hx"
                global::maglev.MagLevArray keys = y4.keys();
                int i1 = 0;
                                #line 137 "/my-component/src/maglev/MagLevCs.hx"
                while ((i1 < keys.size()))
                {
                                        #line 138 "/my-component/src/maglev/MagLevCs.hx"
                    string key = (((global::maglev.MagLevString)(keys.@get(i1)))).getString();
                    map.@set(key, this.convertToHaxe(y4.@get(key)));
                                        #line 140 "/my-component/src/maglev/MagLevCs.hx"
                    ++i1;
                }

                                #line 142 "/my-component/src/maglev/MagLevCs.hx"
                return((object)(map));
            }
            else
            {
                                #line 145 "/my-component/src/maglev/MagLevCs.hx"
                throw ((global::System.Exception)(global::haxe.Exception.thrown("convertToHaxe: unknown type")));
            }
        }