Esempio n. 1
0
        public EVariable Convert(ETypeWord to)
        {
            EVariable tryConvert = ConvertInternal(to);

            if (tryConvert != null)
            {
                return(tryConvert);
            }
            if (GetEType().Get() == to.Get())
            {
                return(this);
            }
            return(CannotConvert(to));
        }
Esempio n. 2
0
        protected override EVariable ConvertInternal(ETypeWord to)
        {
            switch (to.Get())
            {
            case EType.Double:
                return(((EVDouble)New(to)).Set(value));

            case EType.Int:
                return(((EVInt)New(to)).Set(value));

            case EType.Boolean:
                return(((EVBoolean)New(to)).Set(value != 0));
            }
            return(null);
        }
Esempio n. 3
0
 public static EVariable New(ETypeWord type)
 {
     return(New(type.Get()));
 }