예제 #1
0
        public ZergBuilding(Proto.Unit unit, Translator translator) : base(unit, translator)
        {
            var unitType = translator.GetBuildingOrUnitType(unit.UnitType);

            if (unitType.ZergBuilding == ZergBuildingType.Unspecified)
            {
                throw new ArgumentException($"Expected a ZergBuildingType, got '{unitType.ToString()}'.");
            }

            this.ZergBuildingType = unitType.ZergBuilding;
        }
예제 #2
0
        public TerranBuilding(Proto.Unit unit, Translator translator) : base(unit, translator)
        {
            var unitType = translator.GetBuildingOrUnitType(unit.UnitType);

            if (unitType.Value is TerranBuildingType terranBuilding)
            {
                this.TerranBuildingType = terranBuilding;
            }
            else
            {
                throw new ArgumentException($"Expected a TerranBuildingType, got '{unitType.ToString()}'.");
            }
        }
예제 #3
0
        public ProtossUnit(Proto.Unit unit, Translator translator) : base(unit, translator)
        {
            var unitType = translator.GetBuildingOrUnitType(unit.UnitType);

            if (unitType.Value is ProtossUnitType protossUnit)
            {
                this.ProtossUnitType = protossUnit;
            }
            else
            {
                throw new ArgumentException($"Expected a ProtossUnitType, got '{unitType.ToString()}'.");
            }
        }
예제 #4
0
        public ZergBuilding(Proto.Unit unit, Translator translator) : base(unit, translator)
        {
            var unitType = translator.GetBuildingOrUnitType(unit.UnitType);

            if (unitType.Value is ZergBuildingType zergBuilding)
            {
                this.ZergBuildingType = zergBuilding;
            }
            else
            {
                throw new ArgumentException($"Expected a ZergBuildingType, got '{unitType}'.");
            }
        }
예제 #5
0
 public Unit(Proto.Unit unit, Translator translator)
 {
     this.translator = translator;
     this.Raw        = unit;
     this.RawType    = translator.UnitTypes[unit.UnitType];
 }
예제 #6
0
 public Building(Proto.Unit unit, Translator translator) : base(unit, translator)
 {
 }
예제 #7
0
 public UnspecifiedUnit(Proto.Unit unit, Translator translator) : base(unit, translator)
 {
 }