Ejemplo n.º 1
0
 public TimeLengthDefinitionViewModel()
 {
     AvailableUnits = new[] { "Minutes", "Hours" };
     SelectedUnits  = AvailableUnits.First();
     _extraLap      = false;
     _length        = 30;
 }
Ejemplo n.º 2
0
        public void BuildingCompleted(Building b)
        {
            foreach (var typeID in b.Definition.Unlocks)
            {
                if (TechTree.Buildings.TryGetValue(typeID, out var buildingType))
                {
                    if (!AvailableBuildings.Contains(buildingType))
                    {
                        AvailableBuildings.Add(buildingType);
                    }
                }

                else if (TechTree.Units.TryGetValue(typeID, out var unitType))
                {
                    if (!AvailableUnits.Contains(unitType))
                    {
                        AvailableUnits.Add(unitType);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public static object getAttr(Dictionary <string, dynamic> uda_Dic, string key, AvailableUnits unit)
        {
            object     a    = null;
            IAttribute attr = uda_Dic[key];

            switch (attr.ExtentionContentType())
            {
            case ExtContentType.EXT_TYPE_AREA:
                a = attr.Area(unit);
                break;

            case ExtContentType.EXT_TYPE_BLOB:
                break;

            case ExtContentType.EXT_TYPE_BLOB_REF:
                break;

            case ExtContentType.EXT_TYPE_BOOL:
                a = attr.BoolVal();
                break;

            case ExtContentType.EXT_TYPE_CLOB:
                break;

            case ExtContentType.EXT_TYPE_CURRENCY:
                break;

            case ExtContentType.EXT_TYPE_CURRENT:
                break;

            case ExtContentType.EXT_TYPE_DATE:
                break;

            case ExtContentType.EXT_TYPE_DOUBLE:
                a = attr.DoubleVal();
                break;

            case ExtContentType.EXT_TYPE_FREQUENCY:
                break;

            case ExtContentType.EXT_TYPE_INT:
                a = attr.IntVal();
                break;

            case ExtContentType.EXT_TYPE_LENGTH:
                a = attr.Length(unit);
                break;

            case ExtContentType.EXT_TYPE_RESISTANCE:
                break;

            case ExtContentType.EXT_TYPE_STRING:
                a = attr.StrVal();
                break;

            case ExtContentType.EXT_TYPE_TEMPERATURE:
                break;

            case ExtContentType.EXT_TYPE_VOLTAGE:
                break;

            case ExtContentType.EXT_TYPE_WEIGHT:
                a = attr.Weight(unit);
                break;

            case ExtContentType.LAST_EXT_CONT_TYPE:
                break;

            default:
                break;
            }
            return(a);
        }
Ejemplo n.º 4
0
        public static void setAttr(object newValue, string key, dynamic obj, AvailableUnits unit = AvailableUnits.MM)
        {
            IAttribute attr = uda_Dic[key];

            switch (attr.ExtentionContentType())
            {
            case ExtContentType.EXT_TYPE_AREA:
                attModifier.SetArea(key, (double)newValue, unit);
                break;

            case ExtContentType.EXT_TYPE_BLOB:
                break;

            case ExtContentType.EXT_TYPE_BLOB_REF:
                break;

            case ExtContentType.EXT_TYPE_BOOL:
                attModifier.SetBoolean(key, (bool)newValue);
                break;

            case ExtContentType.EXT_TYPE_CLOB:
                break;

            case ExtContentType.EXT_TYPE_CURRENCY:
                break;

            case ExtContentType.EXT_TYPE_CURRENT:
                break;

            case ExtContentType.EXT_TYPE_DATE:
                break;

            case ExtContentType.EXT_TYPE_DOUBLE:
                attModifier.SetDouble(key, (double)newValue);
                break;

            case ExtContentType.EXT_TYPE_ENUM:
                attModifier.SetString(key, (string)newValue);
                break;

            case ExtContentType.EXT_TYPE_FREQUENCY:
                break;

            case ExtContentType.EXT_TYPE_INT:
                attModifier.SetInteger(key, (int)newValue);
                break;

            case ExtContentType.EXT_TYPE_LENGTH:
                attModifier.SetLength(key, (double)newValue, unit);
                break;

            case ExtContentType.EXT_TYPE_RESISTANCE:
                break;

            case ExtContentType.EXT_TYPE_STRING:
                attModifier.SetString(key, (string)newValue);
                break;

            case ExtContentType.EXT_TYPE_TEMPERATURE:
                break;

            case ExtContentType.EXT_TYPE_VOLTAGE:
                break;

            case ExtContentType.EXT_TYPE_WEIGHT:
                attModifier.SetWeight(key, (double)newValue, unit);
                break;

            case ExtContentType.LAST_EXT_CONT_TYPE:
                break;

            default:
                break;
            }
        }