public void SetRange(RangeEnum Range) { var cmd = $"{CMD_RANGE} {((int)Range + 1)}"; port.WriteLine(cmd); Thread.Sleep(10); }
public Weapon(string name, int strength, int magic, RangeEnum rangeType) { Name = name; Strength = strength; Magic = magic; RangeType = rangeType; Validate(this, new WeaponValidator()); }
public virtual void UpdateWeapon(string name, int magic, int strength, RangeEnum rangeType) { Name = name; Magic = magic; Strength = strength; RangeType = rangeType; Validate(this, new WeaponValidator()); }
public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader) { System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader)); this.Input = ((InputEnum)(binaryReader.ReadInt16())); this.Range = ((RangeEnum)(binaryReader.ReadInt16())); pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(pointerQueue.Concat(this.Function.ReadFields(binaryReader))); this.TimePeriod = binaryReader.ReadSingle(); return(pointerQueue); }
// -------------------------------------------------------------------------------------------------------------------------------- /// <summary> /// Creates new invalid weapon /// </summary> public Weapon() : base() { _handType = WeaponHandTypeEnum.SINGLE; _requiredSkill = SkillEnum.CUSTOM; _damage = 0; _criticalRating = 0; _range = RangeEnum.ENGAGED; WfLogger.Log(this, LogLevel.DETAILED, "Created new invalid Weapon from default"); }
{/// <summary> /// Creates weapons /// </summary> /// <param name="itemType">What type of weapon you want, sword or bow</param> /// <param name="damage">The damage of the weapon</param> /// <param name="name">The name of the weapon</param> /// <param name="range">The range of the weapon</param> /// <returns></returns> public AttackItem CreateAttackItem(string itemType, string name, int damage, RangeEnum range = RangeEnum.Short) { switch (itemType) { case "sword": return(new Sword(name, damage)); case "bow": return(new Bow(name, damage, range)); default: return(null); } }
public Weapon(string _name, uint _basePrice, uint _encumbrance, uint _rarity, ItemConditionEnum _condition, Dictionary <ItemQuality, uint> _qualities, List <GenreEnum> _availableGenres, string _descriptionKey, bool _isEquipped, WeaponHandTypeEnum _handType, SkillEnum _requiredSkill, uint _damage, uint _critialRating, RangeEnum _range) : base(_name, _basePrice, _encumbrance, _rarity, _condition, _qualities, _availableGenres, _descriptionKey, _isEquipped) { this._handType = _handType; this._requiredSkill = _requiredSkill; this._damage = _damage; this._criticalRating = _criticalRating; this._range = _range; WfLogger.Log(this, LogLevel.DETAILED, "Created new Weapon " + this._nameKey); }
public void GetRange(out RangeEnum Range) { Range = RangeEnum.RANGE1; var monkey = _query($"{CMD_RANGE}?"); try { Range = (RangeEnum)Enum.Parse(typeof(RangeEnum), monkey); } catch { _throw_excpetion(monkey); } }
// -------------------------------------------------------------------------------------------------------------------------------- /// <summary> /// Creates a copy of the given Weapon /// </summary> /// <param name="other">if null, an invalid weapon item is created</param> public Weapon(Weapon other) : base(other) { if (other == null) { return; } _handType = other._handType; _requiredSkill = other._requiredSkill; _damage = other._damage; _criticalRating = other._criticalRating; _range = other._range; WfLogger.Log(this, LogLevel.DETAILED, "Created new Weapon from another"); }
/// <summary> /// Format the optical power value accorrding to the Unit and Range. /// </summary> /// <param name="Unit"></param> /// <param name="Range"></param> /// <param name="Power"></param> /// <param name="Formatted"></param> public static void FormatOutputPower(UnitEnum Unit, RangeEnum Range, double Power, out string Formatted) { Formatted = ""; switch (Unit) { case UnitEnum.dBm: Formatted = Power.ToString("F3"); break; case UnitEnum.W: case UnitEnum.A: case UnitEnum.V: var tmp = Power.ToString("F10"); Formatted = tmp.Remove(tmp.Length - 1 - (int)Range); break; } }
/// <summary> /// 是否具备某个射程 /// </summary> /// <param name="range">射程</param> /// <returns></returns> public bool HasRange(RangeEnum range) { bool hasNow = ranges.Contains(range); BuffList.ForEach(x => { RangeBuff buff = x as RangeBuff; if (buff != null) { if (buff.IsAdding) { hasNow = true; return; } else { hasNow = false; } } }); return(hasNow); }
/// <summary> /// Initializes a new instance of the <see cref="GetCorporationsCorporationIdOrders200Ok" /> class. /// </summary> /// <param name="duration">Number of days for which order is valid (starting from the issued date). An order expires at time issued + duration (required).</param> /// <param name="escrow">For buy orders, the amount of ISK in escrow.</param> /// <param name="isBuyOrder">True if the order is a bid (buy) order.</param> /// <param name="issued">Date and time when this order was issued (required).</param> /// <param name="locationId">ID of the location where order was placed (required).</param> /// <param name="minVolume">For buy orders, the minimum quantity that will be accepted in a matching sell order.</param> /// <param name="orderId">Unique order ID (required).</param> /// <param name="price">Cost per unit for this order (required).</param> /// <param name="range">Valid order range, numbers are ranges in jumps (required).</param> /// <param name="regionId">ID of the region where order was placed (required).</param> /// <param name="typeId">The type ID of the item transacted in this order (required).</param> /// <param name="volumeRemain">Quantity of items still required or offered (required).</param> /// <param name="volumeTotal">Quantity of items required or offered at time order was placed (required).</param> /// <param name="walletDivision">The corporation wallet division used for this order. (required).</param> public GetCorporationsCorporationIdOrders200Ok(int? duration = default(int?), double? escrow = default(double?), bool? isBuyOrder = default(bool?), DateTime? issued = default(DateTime?), long? locationId = default(long?), int? minVolume = default(int?), long? orderId = default(long?), double? price = default(double?), RangeEnum range = default(RangeEnum), int? regionId = default(int?), int? typeId = default(int?), int? volumeRemain = default(int?), int? volumeTotal = default(int?), int? walletDivision = default(int?)) { // to ensure "duration" is required (not null) if (duration == null) { throw new InvalidDataException("duration is a required property for GetCorporationsCorporationIdOrders200Ok and cannot be null"); } else { this.Duration = duration; } // to ensure "issued" is required (not null) if (issued == null) { throw new InvalidDataException("issued is a required property for GetCorporationsCorporationIdOrders200Ok and cannot be null"); } else { this.Issued = issued; } // to ensure "locationId" is required (not null) if (locationId == null) { throw new InvalidDataException("locationId is a required property for GetCorporationsCorporationIdOrders200Ok and cannot be null"); } else { this.LocationId = locationId; } // to ensure "orderId" is required (not null) if (orderId == null) { throw new InvalidDataException("orderId is a required property for GetCorporationsCorporationIdOrders200Ok and cannot be null"); } else { this.OrderId = orderId; } // to ensure "price" is required (not null) if (price == null) { throw new InvalidDataException("price is a required property for GetCorporationsCorporationIdOrders200Ok and cannot be null"); } else { this.Price = price; } // to ensure "range" is required (not null) if (range == null) { throw new InvalidDataException("range is a required property for GetCorporationsCorporationIdOrders200Ok and cannot be null"); } else { this.Range = range; } // to ensure "regionId" is required (not null) if (regionId == null) { throw new InvalidDataException("regionId is a required property for GetCorporationsCorporationIdOrders200Ok and cannot be null"); } else { this.RegionId = regionId; } // to ensure "typeId" is required (not null) if (typeId == null) { throw new InvalidDataException("typeId is a required property for GetCorporationsCorporationIdOrders200Ok and cannot be null"); } else { this.TypeId = typeId; } // to ensure "volumeRemain" is required (not null) if (volumeRemain == null) { throw new InvalidDataException("volumeRemain is a required property for GetCorporationsCorporationIdOrders200Ok and cannot be null"); } else { this.VolumeRemain = volumeRemain; } // to ensure "volumeTotal" is required (not null) if (volumeTotal == null) { throw new InvalidDataException("volumeTotal is a required property for GetCorporationsCorporationIdOrders200Ok and cannot be null"); } else { this.VolumeTotal = volumeTotal; } // to ensure "walletDivision" is required (not null) if (walletDivision == null) { throw new InvalidDataException("walletDivision is a required property for GetCorporationsCorporationIdOrders200Ok and cannot be null"); } else { this.WalletDivision = walletDivision; } this.Escrow = escrow; this.IsBuyOrder = isBuyOrder; this.MinVolume = minVolume; }
public Bow(string name, int damage, RangeEnum range) : base(name, damage) { Type = AttackEnum.Bow; Range = range; }
public RangeBuff(Skill origin, bool isAdding, RangeEnum value, LastingTypeEnum lastingType = LastingTypeEnum.Forever) : base(origin, lastingType) { IsAdding = isAdding; Value = value; }
/// <summary> /// Initializes a new instance of the <see cref="GetCorporationsCorporationIdOrdersHistory200Ok" /> class. /// </summary> /// <param name="Duration">Number of days the order was valid for (starting from the issued date). An order expires at time issued + duration (required).</param> /// <param name="Escrow">For buy orders, the amount of ISK in escrow.</param> /// <param name="IsBuyOrder">True if the order is a bid (buy) order.</param> /// <param name="Issued">Date and time when this order was issued (required).</param> /// <param name="IssuedBy">The character who issued this order.</param> /// <param name="LocationId">ID of the location where order was placed (required).</param> /// <param name="MinVolume">For buy orders, the minimum quantity that will be accepted in a matching sell order.</param> /// <param name="OrderId">Unique order ID (required).</param> /// <param name="Price">Cost per unit for this order (required).</param> /// <param name="Range">Valid order range, numbers are ranges in jumps (required).</param> /// <param name="RegionId">ID of the region where order was placed (required).</param> /// <param name="State">Current order state (required).</param> /// <param name="TypeId">The type ID of the item transacted in this order (required).</param> /// <param name="VolumeRemain">Quantity of items still required or offered (required).</param> /// <param name="VolumeTotal">Quantity of items required or offered at time order was placed (required).</param> /// <param name="WalletDivision">The corporation wallet division used for this order (required).</param> public GetCorporationsCorporationIdOrdersHistory200Ok(int?Duration = default(int?), double?Escrow = default(double?), bool?IsBuyOrder = default(bool?), DateTime?Issued = default(DateTime?), int?IssuedBy = default(int?), long?LocationId = default(long?), int?MinVolume = default(int?), long?OrderId = default(long?), double?Price = default(double?), RangeEnum Range = default(RangeEnum), int?RegionId = default(int?), StateEnum State = default(StateEnum), int?TypeId = default(int?), int?VolumeRemain = default(int?), int?VolumeTotal = default(int?), int?WalletDivision = default(int?)) { // to ensure "Duration" is required (not null) if (Duration == null) { throw new InvalidDataException("Duration is a required property for GetCorporationsCorporationIdOrdersHistory200Ok and cannot be null"); } else { this.Duration = Duration; } // to ensure "Issued" is required (not null) if (Issued == null) { throw new InvalidDataException("Issued is a required property for GetCorporationsCorporationIdOrdersHistory200Ok and cannot be null"); } else { this.Issued = Issued; } // to ensure "LocationId" is required (not null) if (LocationId == null) { throw new InvalidDataException("LocationId is a required property for GetCorporationsCorporationIdOrdersHistory200Ok and cannot be null"); } else { this.LocationId = LocationId; } // to ensure "OrderId" is required (not null) if (OrderId == null) { throw new InvalidDataException("OrderId is a required property for GetCorporationsCorporationIdOrdersHistory200Ok and cannot be null"); } else { this.OrderId = OrderId; } // to ensure "Price" is required (not null) if (Price == null) { throw new InvalidDataException("Price is a required property for GetCorporationsCorporationIdOrdersHistory200Ok and cannot be null"); } else { this.Price = Price; } // to ensure "Range" is required (not null) if (Range == null) { throw new InvalidDataException("Range is a required property for GetCorporationsCorporationIdOrdersHistory200Ok and cannot be null"); } else { this.Range = Range; } // to ensure "RegionId" is required (not null) if (RegionId == null) { throw new InvalidDataException("RegionId is a required property for GetCorporationsCorporationIdOrdersHistory200Ok and cannot be null"); } else { this.RegionId = RegionId; } // to ensure "State" is required (not null) if (State == null) { throw new InvalidDataException("State is a required property for GetCorporationsCorporationIdOrdersHistory200Ok and cannot be null"); } else { this.State = State; } // to ensure "TypeId" is required (not null) if (TypeId == null) { throw new InvalidDataException("TypeId is a required property for GetCorporationsCorporationIdOrdersHistory200Ok and cannot be null"); } else { this.TypeId = TypeId; } // to ensure "VolumeRemain" is required (not null) if (VolumeRemain == null) { throw new InvalidDataException("VolumeRemain is a required property for GetCorporationsCorporationIdOrdersHistory200Ok and cannot be null"); } else { this.VolumeRemain = VolumeRemain; } // to ensure "VolumeTotal" is required (not null) if (VolumeTotal == null) { throw new InvalidDataException("VolumeTotal is a required property for GetCorporationsCorporationIdOrdersHistory200Ok and cannot be null"); } else { this.VolumeTotal = VolumeTotal; } // to ensure "WalletDivision" is required (not null) if (WalletDivision == null) { throw new InvalidDataException("WalletDivision is a required property for GetCorporationsCorporationIdOrdersHistory200Ok and cannot be null"); } else { this.WalletDivision = WalletDivision; } this.Escrow = Escrow; this.IsBuyOrder = IsBuyOrder; this.IssuedBy = IssuedBy; this.MinVolume = MinVolume; }
/// <summary> /// Set the value of the sampling resistors. /// </summary> /// <param name="Range"></param> /// <param name="Res"></param> public void SetSamplingResistance(RangeEnum Range, double Res) { _write($"{CMD_CAL_RES} {(int)Range},{Res}"); }
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) { if (untypedValue == null) { serializer.Serialize(writer, null); return; } RangeEnum value = (RangeEnum)untypedValue; switch (value) { case RangeEnum.Category: serializer.Serialize(writer, "category"); return; case RangeEnum.Diverging: serializer.Serialize(writer, "diverging"); return; case RangeEnum.Heatmap: serializer.Serialize(writer, "heatmap"); return; case RangeEnum.Height: serializer.Serialize(writer, "height"); return; case RangeEnum.Ordinal: serializer.Serialize(writer, "ordinal"); return; case RangeEnum.Ramp: serializer.Serialize(writer, "ramp"); return; case RangeEnum.Symbol: serializer.Serialize(writer, "symbol"); return; case RangeEnum.Width: serializer.Serialize(writer, "width"); return; } throw new Exception("Cannot marshal type RangeEnum"); }
/// <summary> /// Set the equation to convert the ADC value to optical power. /// </summary> /// <param name="Wavelen"></param> /// <param name="Range"></param> /// <param name="A"></param> /// <param name="B"></param> /// <param name="C"></param> /// <param name="DarkCurrent"></param> public void SetFunc(WavelengthEnum Wavelen, RangeEnum Range, double A, double B, double C, double DarkCurrent) { _write($"{CMD_CAL_FUNC} {(int)Wavelen},{(int)Range},{A},{B},{C},{DarkCurrent}"); }
/// <summary> /// Initializes a new instance of the <see cref="GetMarketsRegionIdOrders200Ok" /> class. /// </summary> /// <param name="Duration">duration integer (required).</param> /// <param name="IsBuyOrder">is_buy_order boolean (required).</param> /// <param name="Issued">issued string (required).</param> /// <param name="LocationId">location_id integer (required).</param> /// <param name="MinVolume">min_volume integer (required).</param> /// <param name="OrderId">order_id integer (required).</param> /// <param name="Price">price number (required).</param> /// <param name="Range">range string (required).</param> /// <param name="SystemId">The solar system this order was placed (required).</param> /// <param name="TypeId">type_id integer (required).</param> /// <param name="VolumeRemain">volume_remain integer (required).</param> /// <param name="VolumeTotal">volume_total integer (required).</param> public GetMarketsRegionIdOrders200Ok(int?Duration = default(int?), bool?IsBuyOrder = default(bool?), DateTime?Issued = default(DateTime?), long?LocationId = default(long?), int?MinVolume = default(int?), long?OrderId = default(long?), double?Price = default(double?), RangeEnum Range = default(RangeEnum), int?SystemId = default(int?), int?TypeId = default(int?), int?VolumeRemain = default(int?), int?VolumeTotal = default(int?)) { // to ensure "Duration" is required (not null) if (Duration == null) { throw new InvalidDataException("Duration is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.Duration = Duration; } // to ensure "IsBuyOrder" is required (not null) if (IsBuyOrder == null) { throw new InvalidDataException("IsBuyOrder is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.IsBuyOrder = IsBuyOrder; } // to ensure "Issued" is required (not null) if (Issued == null) { throw new InvalidDataException("Issued is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.Issued = Issued; } // to ensure "LocationId" is required (not null) if (LocationId == null) { throw new InvalidDataException("LocationId is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.LocationId = LocationId; } // to ensure "MinVolume" is required (not null) if (MinVolume == null) { throw new InvalidDataException("MinVolume is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.MinVolume = MinVolume; } // to ensure "OrderId" is required (not null) if (OrderId == null) { throw new InvalidDataException("OrderId is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.OrderId = OrderId; } // to ensure "Price" is required (not null) if (Price == null) { throw new InvalidDataException("Price is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.Price = Price; } // to ensure "Range" is required (not null) if (Range == null) { throw new InvalidDataException("Range is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.Range = Range; } // to ensure "SystemId" is required (not null) if (SystemId == null) { throw new InvalidDataException("SystemId is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.SystemId = SystemId; } // to ensure "TypeId" is required (not null) if (TypeId == null) { throw new InvalidDataException("TypeId is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.TypeId = TypeId; } // to ensure "VolumeRemain" is required (not null) if (VolumeRemain == null) { throw new InvalidDataException("VolumeRemain is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.VolumeRemain = VolumeRemain; } // to ensure "VolumeTotal" is required (not null) if (VolumeTotal == null) { throw new InvalidDataException("VolumeTotal is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.VolumeTotal = VolumeTotal; } }
/// <summary> /// Initializes a new instance of the <see cref="GetMarketsRegionIdOrders200Ok" /> class. /// </summary> /// <param name="duration">duration integer (required).</param> /// <param name="isBuyOrder">is_buy_order boolean (required).</param> /// <param name="issued">issued string (required).</param> /// <param name="locationId">location_id integer (required).</param> /// <param name="minVolume">min_volume integer (required).</param> /// <param name="orderId">order_id integer (required).</param> /// <param name="price">price number (required).</param> /// <param name="range">range string (required).</param> /// <param name="systemId">The solar system this order was placed (required).</param> /// <param name="typeId">type_id integer (required).</param> /// <param name="volumeRemain">volume_remain integer (required).</param> /// <param name="volumeTotal">volume_total integer (required).</param> public GetMarketsRegionIdOrders200Ok(int?duration = default(int?), bool?isBuyOrder = default(bool?), DateTime?issued = default(DateTime?), long?locationId = default(long?), int?minVolume = default(int?), long?orderId = default(long?), double?price = default(double?), RangeEnum range = default(RangeEnum), int?systemId = default(int?), int?typeId = default(int?), int?volumeRemain = default(int?), int?volumeTotal = default(int?)) { // to ensure "duration" is required (not null) if (duration == null) { throw new InvalidDataException("duration is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.Duration = duration; } // to ensure "isBuyOrder" is required (not null) if (isBuyOrder == null) { throw new InvalidDataException("isBuyOrder is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.IsBuyOrder = isBuyOrder; } // to ensure "issued" is required (not null) if (issued == null) { throw new InvalidDataException("issued is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.Issued = issued; } // to ensure "locationId" is required (not null) if (locationId == null) { throw new InvalidDataException("locationId is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.LocationId = locationId; } // to ensure "minVolume" is required (not null) if (minVolume == null) { throw new InvalidDataException("minVolume is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.MinVolume = minVolume; } // to ensure "orderId" is required (not null) if (orderId == null) { throw new InvalidDataException("orderId is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.OrderId = orderId; } // to ensure "price" is required (not null) if (price == null) { throw new InvalidDataException("price is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.Price = price; } // to ensure "range" is required (not null) if (range == null) { throw new InvalidDataException("range is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.Range = range; } // to ensure "systemId" is required (not null) if (systemId == null) { throw new InvalidDataException("systemId is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.SystemId = systemId; } // to ensure "typeId" is required (not null) if (typeId == null) { throw new InvalidDataException("typeId is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.TypeId = typeId; } // to ensure "volumeRemain" is required (not null) if (volumeRemain == null) { throw new InvalidDataException("volumeRemain is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.VolumeRemain = volumeRemain; } // to ensure "volumeTotal" is required (not null) if (volumeTotal == null) { throw new InvalidDataException("volumeTotal is a required property for GetMarketsRegionIdOrders200Ok and cannot be null"); } else { this.VolumeTotal = volumeTotal; } }