public WallLoadParametrs(DateTime? lastDateToLoad, long? lastPostToLoad) { Offset = null; Count = null; LastDateToLoad = lastDateToLoad; LastPostToLoad = lastPostToLoad; }
internal CommandCompleteMessage Load(NpgsqlBuffer buf, int len) { RowsAffected = null; LastInsertedOID = null; var tag = buf.ReadString(len-1); buf.Skip(1); // Null terminator var tokens = tag.Split(); switch (tokens[0]) { case "INSERT": var lastInsertedOID = uint.Parse(tokens[1]); if (lastInsertedOID != 0) { LastInsertedOID = lastInsertedOID; } goto case "UPDATE"; case "UPDATE": case "DELETE": case "COPY": uint rowsAffected; if (uint.TryParse(tokens[tokens.Length - 1], out rowsAffected)) { RowsAffected = rowsAffected; } break; } return this; }
public Player(JSONDict playerJSON) { ID = playerJSON.SafeGetUintValue("id"); DisplayName = playerJSON.SafeGetStringValue("displayName"); AvatarURL = playerJSON.SafeGetStringValue("avatarURL"); FlagURL = playerJSON.SafeGetStringValue("flagURL"); }
public void loadFromConfiguration(IConfigSource config) { m_defaultHomeLocX = (uint) config.Configs["StandAlone"].GetInt("default_location_x", 1000); m_defaultHomeLocY = (uint) config.Configs["StandAlone"].GetInt("default_location_y", 1000); HttpListenerPort = (uint) config.Configs["Network"].GetInt("http_listener_port", (int) ConfigSettings.DefaultRegionHttpPort); httpSSLPort = (uint)config.Configs["Network"].GetInt("http_listener_sslport", ((int)ConfigSettings.DefaultRegionHttpPort+1)); HttpUsesSSL = config.Configs["Network"].GetBoolean("http_listener_ssl", false); HttpSSLCN = config.Configs["Network"].GetString("http_listener_cn", "localhost"); ConfigSettings.DefaultRegionRemotingPort = (uint) config.Configs["Network"].GetInt("remoting_listener_port", (int) ConfigSettings.DefaultRegionRemotingPort); GridURL = config.Configs["Network"].GetString("grid_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultGridServerHttpPort.ToString()); GridSendKey = config.Configs["Network"].GetString("grid_send_key", "null"); GridRecvKey = config.Configs["Network"].GetString("grid_recv_key", "null"); UserURL = config.Configs["Network"].GetString("user_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultUserServerHttpPort.ToString()); UserSendKey = config.Configs["Network"].GetString("user_send_key", "null"); UserRecvKey = config.Configs["Network"].GetString("user_recv_key", "null"); AssetURL = config.Configs["Network"].GetString("asset_server_url", AssetURL); InventoryURL = config.Configs["Network"].GetString("inventory_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultInventoryServerHttpPort.ToString()); secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true); MessagingURL = config.Configs["Network"].GetString("messaging_server_url", "http://127.0.0.1:" + ConfigSettings.DefaultMessageServerHttpPort); }
public TimedTrafficStep(int minTime, int maxTime, float waitFlowBalance, ushort nodeId, List<ushort> groupNodeIds) { this.nodeId = nodeId; this.minTime = minTime; this.maxTime = maxTime; this.waitFlowBalance = waitFlowBalance; this.timedNode = TrafficLightsTimed.GetTimedLight(nodeId); this.groupNodeIds = groupNodeIds; var node = TrafficLightTool.GetNetNode(nodeId); minFlow = Single.NaN; maxWait = Single.NaN; endTransitionStart = null; stepDone = false; for (var s = 0; s < 8; s++) { var segmentId = node.GetSegment(s); if (segmentId <= 0) continue; addSegment(segmentId); } calcMaxSegmentLength(); }
public override DicomArray<uint> GetTypedValue(IStudyItem item) { DicomAttribute attribute = item[base.Tag]; if (attribute == null) return null; if (attribute.IsNull) return new DicomArray<uint>(); uint?[] result; try { result = new uint?[CountValues(attribute)]; for (int n = 0; n < result.Length; n++) { uint value; if (attribute.TryGetUInt32(n, out value)) result[n] = value; } } catch (DicomException) { return null; } return new DicomArray<uint>(result, FormatArray(result)); }
public StringTrackParser(string NameClue, bool IsFileName = true) { string NC = (IsFileName) ? Path.GetFileNameWithoutExtension(NameClue) : NameClue; if (string.IsNullOrEmpty(NameClue)) { _IsDummy = true; _FoundSomething = true; return; } if (_TrackDummyParser.IsMatch(NC)) { Match m = _TrackDummyParser.Match(NC); _TrackNumber = uint.Parse(m.Groups[1].Success ? m.Groups[1].Value : m.Groups[4].Value); _IsDummy = true; _Name = NC; _FoundSomething = true; return; } if (_TrackSimpleParser.IsMatch(NC)) { _TrackNumber = uint.Parse(_TrackSimpleParser.Match(NC).Groups[1].Value); _IsDummy = false; _Name = _TrackSimpleParser.Match(NC).Groups[2].Value; _FoundSomething = true; return; } _Name = NC; }
internal void FromIconFilter(IconFilter icf) { this.SetAllNull(); this.IconSet = icf.IconSet.Value; if (icf.IconId != null) this.IconId = icf.IconId.Value; }
public VisualStudioProjectTracker(IServiceProvider serviceProvider) { _projectMap = new Dictionary<ProjectId, AbstractProject>(); _projectPathToIdMap = new Dictionary<string, ProjectId>(StringComparer.OrdinalIgnoreCase); _serviceProvider = serviceProvider; _workspaceHosts = new List<WorkspaceHostState>(capacity: 1); _vsSolution = (IVsSolution)serviceProvider.GetService(typeof(SVsSolution)); _runningDocumentTable = (IVsRunningDocumentTable4)serviceProvider.GetService(typeof(SVsRunningDocumentTable)); uint solutionEventsCookie; _vsSolution.AdviseSolutionEvents(this, out solutionEventsCookie); _solutionEventsCookie = solutionEventsCookie; // It's possible that we're loading after the solution has already fully loaded, so see if we missed the event var shellMonitorSelection = (IVsMonitorSelection)serviceProvider.GetService(typeof(SVsShellMonitorSelection)); uint fullyLoadedContextCookie; if (ErrorHandler.Succeeded(shellMonitorSelection.GetCmdUIContextCookie(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_guid, out fullyLoadedContextCookie))) { int fActive; if (ErrorHandler.Succeeded(shellMonitorSelection.IsCmdUIContextActive(fullyLoadedContextCookie, out fActive)) && fActive != 0) { _solutionLoadComplete = true; } } }
protected void DisposeTimeout () { if (timerId != null) { GLib.Source.Remove (timerId.Value); timerId = null; } }
public override void Clear() { this.Index_ = null; this.Text_ = null; #if IncludeUnknownFields this.Unknown1_ = null; #endif }
internal void FromTableStyle(TableStyle ts) { this.SetAllNull(); this.TableStyleInnerXml = ts.InnerXml; // this is a required field, so it can't be null, but just in case... if (ts.Name != null) this.Name = ts.Name.Value; else this.Name = string.Empty; if (ts.Pivot != null) { this.Pivot = ts.Pivot.Value; } if (ts.Table != null) { this.Table = ts.Table.Value; } if (ts.Count != null) { this.Count = ts.Count.Value; } }
internal void FromMeasureDimensionMap(MeasureDimensionMap mdm) { this.SetAllNull(); if (mdm.MeasureGroup != null) this.MeasureGroup = mdm.MeasureGroup.Value; if (mdm.Dimension != null) this.Dimension = mdm.Dimension.Value; }
private NotificationMessage acceptTextMessage (string data) { var json = JObject.Parse (data); var id = (uint) json ["user_id"]; var name = (string) json ["name"]; var type = (string) json ["type"]; string message; if (type == "message") message = String.Format ("{0}: {1}", name, (string) json ["message"]); else if (type == "start_music") message = String.Format ("{0}: Started playing music!", name); else if (type == "connection") { var users = (JArray) json ["message"]; var msg = new StringBuilder ("Now keeping connections:"); foreach (JToken user in users) msg.AppendFormat ( "\n- user_id: {0} name: {1}", (uint) user ["user_id"], (string) user ["name"]); message = msg.ToString (); } else if (type == "connected") { _id = id; _heartbeatTimer.Change (30000, 30000); message = String.Format ("user_id: {0} name: {1}", id, name); } else message = "Received unknown type message."; return new NotificationMessage { Summary = String.Format ("AudioStreamer ({0})", type), Body = message, Icon = "notification-message-im" }; }
public SharedMemoryListener(IPCPeer peer) { _waitHandle = new EventWaitHandle(false, EventResetMode.ManualReset, EventName); _exit = false; _peer = peer; _lastSyncedVersion = null; }
public static void CheckUnaryIncrementNullableUIntTest() { uint?[] values = new uint?[] { null, 0, 1, uint.MaxValue }; for (int i = 0; i < values.Length; i++) { VerifyIncrementNullableUInt(values[i]); } }
private void IncreaseValue(object sender, RoutedEventArgs e) { if (Value == null) { Value = Minimum; } else { Value += 1U; } }
private void SetAllNull() { this.TableStyleInnerXml = string.Empty; this.Name = string.Empty; this.Pivot = null; this.Table = null; this.Count = null; }
public void Disconnect() { _timer.Change (-1, -1); _websocket.Close (CloseStatusCode.Away); _audioBox.Clear (); _id = null; _name = null; }
// pictureoptions? internal SLDataPointOptions(List<System.Drawing.Color> ThemeColors) { this.ShapeProperties = new SLA.SLShapeProperties(ThemeColors); this.InvertIfNegative = null; this.Marker = new SLMarker(ThemeColors); this.iExplosion = null; this.bBubble3D = null; }
private void OnAddNumber() { var number = _CurrentNumber.GetValueOrDefault(); _ConvertionViewModels.Insert(0, new ConvertionViewModel(_Dispatcher, number)); CurrentNumber = null; }
public static void CheckUnaryDecrementNullableUIntTest(bool useInterpreter) { uint?[] values = new uint?[] { null, 0, 1, uint.MaxValue }; for (int i = 0; i < values.Length; i++) { VerifyDecrementNullableUInt(values[i], useInterpreter); } }
internal static IDisposable RegisterListener() { var service = ComObjects.VirtualDesktopNotificationService; listener = new VirtualDesktopNotificationListener(); dwCookie = service.Register(listener); return Disposable.Create(() => service.Unregister(dwCookie.Value)); }
public override void Clear() { this.Category_ = null; this.ID_ = null; this.Name1_ = null; this.Name2_ = null; this.Description_ = null; this.Extra_ = null; }
public Configuration(Operation operation, Constraints constraints = MathPractice.Constraints.None, Nullable<uint> leftDigits = null, Nullable<uint> rightDigits = null, bool skipVerticalPrompt = false, uint? numberOfQuestions = null) { Operation = operation; Constraints = constraints; LeftDigits = leftDigits; RightDigits = rightDigits; SkipVerticalPrompt = skipVerticalPrompt; NumberOfQuestions = numberOfQuestions; }
}//constructor #endregion //public constructors private void Init() { this._iLevelDown = null; this._bCompParams = false; this._bLinkParams = false; this._bClassInstanceInfo = false; this._bSubclassInstanceInfo = false; this._bInstanceUseClassName = false; }//Init
public AudioStreamer(string url) { _ws = new WebSocket(url); _msgQ = Queue.Synchronized(new Queue()); _audioBox = new Dictionary<uint, Queue>(); _user_id = null; configure(); }
public uint Increment() { value = Instances.MainCounterStore.Increment(Key, RetrieveValue); if (localCacheLifespan != null) { Instances.LocalCache.Delete(Key); } return Value; }
/// <summary> /// Applies the setting. /// </summary> /// <param name="setting">The setting.</param> public void ApplySetting(StickySettings setting) { base.ApplySetting(setting); this.Channel = setting.Channel; if (setting.StickTime > 0) { this.StickTime = setting.StickTime; } }
public static void CheckNullableUIntPowerTest() { uint?[] array = new uint?[] { null, 0, 1, uint.MaxValue }; for (int i = 0; i < array.Length; i++) { for (int j = 0; j < array.Length; j++) { VerifyNullableUIntPower(array[i], array[j]); } } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { uint uFee = Parse(Request["dwUniFee"]); uint uUintTime = Parse(Request["dwUniTime"]); UNIFEE FeeValue = new UNIFEE(); FEEREQ vrFeeGet = new FEEREQ(); vrFeeGet.dwFeeSN = Parse(Request["dwFeeSN"]); UNIFEE[] feeList; if (m_Request.Fee.Get(vrFeeGet, out feeList) == REQUESTCODE.EXECUTE_SUCCESS && feeList != null && feeList.Length > 0) { FeeValue = feeList[0]; FEEDETAIL detail = new FEEDETAIL(); detail.dwFeeType = (uint)FEEDETAIL.DWFEETYPE.FEETYPE_USEDEV; detail.dwUnitFee = uFee * 100; detail.dwUnitTime = uUintTime; FeeValue.szFeeDetail = new FEEDETAIL[1]; FeeValue.szFeeDetail[0] = new FEEDETAIL(); FeeValue.szFeeDetail[0] = detail; } else { //新建收费标准 uint?uMax = 0; uint uID = PRFee.FEE_BASE | PRFee.MSREQ_FEE_SET; if (GetMaxValue(ref uMax, uID, "dwFEESN")) { } FeeValue.dwFeeSN = uMax; UNIDEVICE setValue; if (!getDevByID(Request["dwID"].ToString(), out setValue)) { MessageBox("资源信息获取失败", "资源信息获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL); return; } FeeValue.dwDevKind = setValue.dwKindID; FeeValue.dwPriority = 2; FeeValue.dwPurpose = 55; FeeValue.szFeeName = setValue.szDevName.ToString() + "收费标准"; FEEDETAIL detail = new FEEDETAIL(); detail.dwFeeType = (uint)FEEDETAIL.DWFEETYPE.FEETYPE_USEDEV; detail.dwUnitFee = uFee * 100; detail.dwUnitTime = uUintTime; FeeValue.szFeeDetail = new FEEDETAIL[1]; FeeValue.szFeeDetail[0] = new FEEDETAIL(); FeeValue.szFeeDetail[0] = detail; } if (m_Request.Fee.Set(FeeValue, out FeeValue) == REQUESTCODE.EXECUTE_SUCCESS) { Logger.trace(m_Request.szErrMessage); MessageBox("设置成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK); } } if (Request["op"] == "set") { UNIDEVICE setValue; if (!getDevByID(Request["dwID"].ToString(), out setValue)) { MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL); return; } bSet = true; FEEREQ vrFeeGet = new FEEREQ(); vrFeeGet.dwDevKind = setValue.dwKindID; UNIFEE[] vtFee; if (m_Request.Fee.Get(vrFeeGet, out vtFee) != REQUESTCODE.EXECUTE_SUCCESS) { MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL); } else { if (vtFee.Length == 0) { //MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL); } else { PutMemberValue("dwFeeSN", vtFee[0].dwFeeSN.ToString()); PutMemberValue("dwUniFee", (vtFee[0].szFeeDetail[0].dwUnitFee / 100).ToString()); PutMemberValue("dwUniTime", (vtFee[0].szFeeDetail[0].dwUnitTime).ToString()); m_Title = "修改收费标准"; } } } else { } }
public static void SetDatZipInfo(RvTreeRow treeRow, string outputDir) { _gameId = null; _treeRow = treeRow; _outputdir = outputDir; }
public OrCondition(IEnumerable <IOperator> operands, string field, uint?boost = null) : this(operands, new Field(field), boost) { }
public void WriteOffset32(uint?value) { this.WriteUInt32(value ?? 0); }
/// <summary> /// Set Capabilities field</summary> /// <param name="capabilities_">Nullable field value to be set</param> public void SetCapabilities(uint?capabilities_) { SetFieldValue(5, 0, capabilities_, Fit.SubfieldIndexMainField); }
private protected CrossValidationResult[] CrossValidateTrain(IDataView data, IEstimator <ITransformer> estimator, int numFolds, string samplingKeyColumn, uint?seed = null) { Environment.CheckValue(data, nameof(data)); Environment.CheckValue(estimator, nameof(estimator)); Environment.CheckParam(numFolds > 1, nameof(numFolds), "Must be more than 1"); Environment.CheckValueOrNull(samplingKeyColumn); DataOperationsCatalog.EnsureGroupPreservationColumn(Environment, ref data, ref samplingKeyColumn, seed); Func <int, CrossValidationResult> foldFunction = fold => { var trainFilter = new RangeFilter(Environment, new RangeFilter.Options { Column = samplingKeyColumn, Min = (double)fold / numFolds, Max = (double)(fold + 1) / numFolds, Complement = true }, data); var testFilter = new RangeFilter(Environment, new RangeFilter.Options { Column = samplingKeyColumn, Min = (double)fold / numFolds, Max = (double)(fold + 1) / numFolds, Complement = false }, data); var model = estimator.Fit(trainFilter); var scoredTest = model.Transform(testFilter); return(new CrossValidationResult(model, scoredTest, fold)); }; // Sequential per-fold training. // REVIEW: we could have a parallel implementation here. We would need to // spawn off a separate host per fold in that case. var result = new CrossValidationResult[numFolds]; for (int fold = 0; fold < numFolds; fold++) { result[fold] = foldFunction(fold); } return(result); }
internal EmbeddedResource(string name, ManifestResourceAttributes attributes, uint offset, MetadataReader reader) : base(name, attributes) { this.offset = offset; this.reader = reader; }
/// <summary> /// Set SleepTime field /// Comment: Typical bed time</summary> /// <param name="sleepTime_">Nullable field value to be set</param> public void SetSleepTime(uint?sleepTime_) { SetFieldValue(29, 0, sleepTime_, Fit.SubfieldIndexMainField); }
/// <summary> /// Set WakeTime field /// Comment: Typical wake time</summary> /// <param name="wakeTime_">Nullable field value to be set</param> public void SetWakeTime(uint?wakeTime_) { SetFieldValue(28, 0, wakeTime_, Fit.SubfieldIndexMainField); }
/// <inheritdoc /> public Task <SearchDialogsResponse> SearchDialogsAsync(string query, ProfileFields fields = null, uint?limit = null) { return(TypeHelper.TryInvokeMethodAsync(func: () => SearchDialogs(query: query, fields: fields, limit: limit))); }
/// <inheritdoc /> public Task <bool> DeleteConversationAsync(long?userId, long?peerId = null, uint?offset = null, uint?count = null, long?groupId = null) { return(TypeHelper.TryInvokeMethodAsync(func: () => DeleteConversation(userId, peerId, offset, count, groupId))); }
/// <inheritdoc /> public Task <VkCollection <Message> > GetByIdAsync(IEnumerable <ulong> messageIds, uint?previewLength = null) { return(TypeHelper.TryInvokeMethodAsync(func: () => GetById(messageIds: messageIds, previewLength: previewLength))); }
/// <inheritdoc /> public Task <bool> DeleteDialogAsync(long?userId, long?peerId = null, uint?offset = null, uint?count = null) { return(TypeHelper.TryInvokeMethodAsync(func: () => DeleteDialog(userId: userId, peerId: peerId, offset: offset, count: count))); }
public static void SetDatZipInfo(int gameId, string outputDir) { _gameId = (uint?)gameId; _treeRow = null; _outputdir = outputDir; }
/// <summary> /// Initializes default opeartion definition and applies customizations (if any). /// </summary> public OperationDefinition GetOperationDefinition(MethodInfo methodInfo, XName qualifiedName, uint?version) { var operationDefinition = new OperationDefinition(qualifiedName, version, methodInfo); operationDefinition.ExtensionSchemaExporter?.ExportOperationDefinition(operationDefinition); schemaExporter.ExportOperationDefinition(operationDefinition); return(operationDefinition); }
public static void Main() { if (MultiAdminConfig.GlobalConfig.SafeServerShutdown.Value) { AppDomain.CurrentDomain.ProcessExit += OnExit; if (OperatingSystem.IsLinux()) { #if LINUX exitSignalListener = new UnixExitSignal(); #endif } else if (OperatingSystem.IsWindows()) { exitSignalListener = new WinExitSignal(); } if (exitSignalListener != null) { exitSignalListener.Exit += OnExit; } } // Remove executable path if (Args.Length > 0) { Args[0] = null; } Headless = GetFlagFromArgs(Args, "headless", "h"); string serverIdArg = GetParamFromArgs(Args, "server-id", "id"); string configArg = GetParamFromArgs(Args, "config", "c"); portArg = uint.TryParse(GetParamFromArgs(Args, "port", "p"), out uint port) ? (uint?)port : null; Server server = null; if (!string.IsNullOrEmpty(serverIdArg) || !string.IsNullOrEmpty(configArg)) { server = new Server(serverIdArg, configArg, portArg, Args); InstantiatedServers.Add(server); } else { if (Servers.IsEmpty()) { server = new Server(port: portArg, args: Args); InstantiatedServers.Add(server); } else { Server[] autoStartServers = AutoStartServers; if (autoStartServers.IsEmpty()) { Write("No servers are set to automatically start, please enter a Server ID to start:"); InputHandler.InputPrefix?.Write(); server = new Server(Console.ReadLine(), port: portArg, args: Args); InstantiatedServers.Add(server); } else { Write("Starting this instance in multi server mode..."); for (int i = 0; i < autoStartServers.Length; i++) { if (i == 0) { server = autoStartServers[i]; InstantiatedServers.Add(server); } else { StartServer(autoStartServers[i]); } } } } } if (server != null) { if (!string.IsNullOrEmpty(server.serverId) && !string.IsNullOrEmpty(server.configLocation)) { Write( $"Starting this instance with Server ID: \"{server.serverId}\" and config directory: \"{server.configLocation}\"..."); } else if (!string.IsNullOrEmpty(server.serverId)) { Write($"Starting this instance with Server ID: \"{server.serverId}\"..."); } else if (!string.IsNullOrEmpty(server.configLocation)) { Write($"Starting this instance with config directory: \"{server.configLocation}\"..."); } else { Write("Starting this instance in single server mode..."); } server.StartServer(); } }
private void CoreSendValue(string name, object?value, out ValueKind valueKind, bool commandName = true, bool kind = true, ValueKind?forceValue = null, uint?handle = null) { if (_stream.BaseWriter is null) { valueKind = ValueKind.Null; return; } valueKind = default; if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException(nameof(name)); } if (value is not byte && value is not sbyte && value is not short && value is not ushort && value is not int && value is not uint && value is not long && value is not ulong && value is not float && value is not double && value is not string && value is not byte[] && value is not sbyte[] && value is not short[] && value is not ushort[] && value is not int[] && value is not uint[] && value is not long[] && value is not ulong[] && value is not float[] && value is not double[] && value is not string[] && value is not IEnumerable && value is not null) { throw new ArgumentException( "Value is of an invalid type. Valid types are (or inherit from) byte, sbyte, short, ushort, int, " + "uint, long, ulong, float, double, string, an array of one of the aforementioned types, or " + "IEnumerable"); } if (value is byte byteValue) { Assert(forceValue, ValueKind.Byte); WriteValueCommand(_stream, handle, commandName); if (kind) { _stream.BaseWriter !.Write((byte)(valueKind = ValueKind.Byte)); } if (commandName) { _stream.BaseWriter !.WriteDf2String(name); } _stream.BaseWriter !.Write(byteValue); } else if (value is sbyte sbyteValue) { Assert(forceValue, ValueKind.SByte); WriteValueCommand(_stream, handle, commandName); if (kind) { _stream.BaseWriter !.Write((byte)(valueKind = ValueKind.SByte)); } if (commandName) { _stream.BaseWriter.WriteDf2String(name); } _stream.BaseWriter !.Write(sbyteValue); } else if (value is short shortValue) { Assert(forceValue, ValueKind.Short); WriteValueCommand(_stream, handle, commandName); if (kind) { _stream.BaseWriter !.Write((byte)(valueKind = ValueKind.Short)); } if (commandName) { _stream.BaseWriter.WriteDf2String(name); } _stream.BaseWriter !.WriteDf2Int(shortValue); } else if (value is ushort ushortValue) { Assert(forceValue, ValueKind.UShort); WriteValueCommand(_stream, handle, commandName); if (kind) { _stream.BaseWriter !.Write((byte)(valueKind = ValueKind.UShort)); } if (commandName) { _stream.BaseWriter.WriteDf2String(name); } _stream.BaseWriter !.WriteDf2UInt(ushortValue); } else if (value is int intValue) { Assert(forceValue, ValueKind.Int); WriteValueCommand(_stream, handle, commandName); if (kind) { _stream.BaseWriter !.Write((byte)(valueKind = ValueKind.Int)); } if (commandName) { _stream.BaseWriter.WriteDf2String(name); } _stream.BaseWriter !.WriteDf2Int(intValue); } else if (value is uint uintValue) { Assert(forceValue, ValueKind.UInt); WriteValueCommand(_stream, handle, commandName); if (kind) { _stream.BaseWriter !.Write((byte)(valueKind = ValueKind.UInt)); } if (commandName) { _stream.BaseWriter.WriteDf2String(name); } _stream.BaseWriter !.WriteDf2UInt(uintValue); } else if (value is long longValue) { Assert(forceValue, ValueKind.Long); WriteValueCommand(_stream, handle, commandName); if (kind) { _stream.BaseWriter !.Write((byte)(valueKind = ValueKind.Long)); } if (commandName) { _stream.BaseWriter.WriteDf2String(name); } _stream.BaseWriter !.WriteDf2Int64(longValue); } else if (value is ulong ulongValue) { Assert(forceValue, ValueKind.ULong); WriteValueCommand(_stream, handle, commandName); if (kind) { _stream.BaseWriter !.Write((byte)(valueKind = ValueKind.ULong)); } if (commandName) { _stream.BaseWriter.WriteDf2String(name); } _stream.BaseWriter !.WriteDf2UInt64(ulongValue); } else if (value is float floatValue) { Assert(forceValue, ValueKind.Float); WriteValueCommand(_stream, handle, commandName); if (kind) { _stream.BaseWriter !.Write((byte)(valueKind = ValueKind.Float)); } if (commandName) { _stream.BaseWriter.WriteDf2String(name); } _stream.BaseWriter !.Write(floatValue); } else if (value is double doubleValue) { Assert(forceValue, ValueKind.Double); WriteValueCommand(_stream, handle, commandName); if (kind) { _stream.BaseWriter !.Write((byte)(valueKind = ValueKind.Double)); } if (commandName) { _stream.BaseWriter.WriteDf2String(name); } _stream.BaseWriter !.Write(doubleValue); } else if (value is string stringValue) { Assert(forceValue, ValueKind.String); WriteValueCommand(_stream, handle, commandName); if (kind) { _stream.BaseWriter !.Write((byte)(valueKind = ValueKind.String)); } if (commandName) { _stream.BaseWriter.WriteDf2String(name); } _stream.BaseWriter !.WriteDf2String(stringValue); } else if (value is Array arrayValue) { Assert(forceValue, ValueKind.Array); WriteValueCommand(_stream, handle, commandName); if (kind) { _stream.BaseWriter !.Write((byte)(valueKind = ValueKind.Array)); } if (commandName) { _stream.BaseWriter.WriteDf2String(name); } var arrayKind = arrayValue switch { _ when arrayValue.GetType() == typeof(byte[]) => ValueKind.Byte, _ when arrayValue.GetType() == typeof(sbyte[]) => ValueKind.SByte, _ when arrayValue.GetType() == typeof(short[]) => ValueKind.Short, _ when arrayValue.GetType() == typeof(ushort[]) => ValueKind.UShort, _ when arrayValue.GetType() == typeof(int[]) => ValueKind.Int, _ when arrayValue.GetType() == typeof(uint[]) => ValueKind.UInt, _ when arrayValue.GetType() == typeof(long[]) => ValueKind.Long, _ when arrayValue.GetType() == typeof(ulong[]) => ValueKind.ULong, _ when arrayValue.GetType() == typeof(float[]) => ValueKind.Float, _ when arrayValue.GetType() == typeof(double[]) => ValueKind.Double, _ when arrayValue.GetType() == typeof(string[]) => ValueKind.String, _ => throw new InvalidOperationException("Invalid array type") }; _stream.BaseWriter !.Write((byte)arrayKind); _stream.BaseWriter !.WriteDf2UInt((uint)arrayValue.Length); foreach (var obj in arrayValue) { CoreSendValue("<DO NOT SEND>", obj, out _, false, false); } } else if (value is IEnumerable enumerableValue) { Assert(forceValue, ValueKind.List); WriteValueCommand(_stream, handle, commandName); if (commandName) { _stream.BaseWriter !.WriteDf2String(name); } foreach (var o in enumerableValue) { CoreSendValue("<DO NOT SEND>", o, out _, false, false); } _stream.BaseWriter !.Write((byte)ValueKind.ListTerminator); } else { Assert(forceValue, ValueKind.Null); WriteValueCommand(_stream, handle, commandName); }
/// <summary> /// Creates a new <see cref="ResizableLimits"/> instance with the provided <see cref="Minimum"/> and <see cref="Maximum"/> values. /// </summary> /// <param name="minimum">Initial length (in units of table elements or 65,536-byte pages).</param> /// <param name="maximum">Maximum length (in units of table elements or 65,536-byte pages).</param> public ResizableLimits(uint minimum, uint?maximum = null) { this.Minimum = minimum; this.Maximum = maximum; }
public static TestFkTable GetById(uint?id, Database database = null) { Args.ThrowIfNull(id, "id"); Args.ThrowIf(!id.HasValue, "specified TestFkTable.Id was null"); return(GetById(id.Value, database)); }
public OrCondition(IEnumerable <IOperator> operands, IField field = null, uint?boost = null) : base(operands, field, boost) { }
public void SetBorderColor(Border view, uint?color) { view.BorderBrush = color.HasValue ? new SolidColorBrush(ColorHelpers.Parse(color.Value)) : null; }
public override void WriteValue(uint?value) { base.WriteValue(value); WritePrimitive(new NullableUInt32MsgpackValue(mState, value)); }
static void FromUInt32() { Console.WriteLine("--- FromUInt32"); uint?[] a = new uint?[] { new uint?(), new uint?(20), new uint?(30) }; TestCore(a); }
public SubpassDependency2KHR ( StructureType?sType = StructureType.SubpassDependency2, void *pNext = null, uint?srcSubpass = null, uint?dstSubpass = null, PipelineStageFlags?srcStageMask = null, PipelineStageFlags?dstStageMask = null, AccessFlags?srcAccessMask = null, AccessFlags?dstAccessMask = null, DependencyFlags?dependencyFlags = null, int?viewOffset = null ) : this() { if (sType is not null) { SType = sType.Value; } if (pNext is not null) { PNext = pNext; } if (srcSubpass is not null) { SrcSubpass = srcSubpass.Value; } if (dstSubpass is not null) { DstSubpass = dstSubpass.Value; } if (srcStageMask is not null) { SrcStageMask = srcStageMask.Value; } if (dstStageMask is not null) { DstStageMask = dstStageMask.Value; } if (srcAccessMask is not null) { SrcAccessMask = srcAccessMask.Value; } if (dstAccessMask is not null) { DstAccessMask = dstAccessMask.Value; } if (dependencyFlags is not null) { DependencyFlags = dependencyFlags.Value; } if (viewOffset is not null) { ViewOffset = viewOffset.Value; } }
public int DeleteByArea_id(uint?Area_id) { return(SqlHelper.ExecuteNonQuery(string.Concat(TSQL.Delete, "`area_id` = ?area_id"), GetParameter("?area_id", MySqlDbType.UInt32, 10, Area_id))); }
public Instruction(OpCode opcode, ValueType dataType, uint?label, object data = null) : this(opcode, dataType, data) { Label = label; }
public int DeleteByCategory_id(uint?Category_id) { return(SqlHelper.ExecuteNonQuery(string.Concat(TSQL.Delete, "`category_id` = ?category_id"), GetParameter("?category_id", MySqlDbType.UInt32, 10, Category_id))); }
public void ApplyExplosionDamageAndForces( Server server, Vector3 explosionPosition, float explosionRadius, float maxExplosionForce, float maxDamage, uint?attackerPlayerId ) { // apply damage & forces to players within range var affectedColliders = Physics.OverlapSphere(explosionPosition, explosionRadius); var affectedColliderPlayerObjectComponents = affectedColliders .Select(collider => collider.gameObject.FindComponentInObjectOrAncestor <PlayerObjectComponent>()) .ToArray(); var affectedPlayerPointPairs = affectedColliders .Select((collider, colliderIndex) => new System.Tuple <PlayerObjectComponent, Vector3>( affectedColliderPlayerObjectComponents[colliderIndex], collider.ClosestPoint(explosionPosition) ) ) .Where(pair => pair.Item1 != null) .GroupBy(pair => pair.Item1) .Select(g => g .OrderBy(pair => Vector3.Distance(pair.Item2, explosionPosition)) .FirstOrDefault() ) .ToArray(); foreach (var pair in affectedPlayerPointPairs) { // Apply damage. var playerObjectComponent = pair.Item1; var closestPointToExplosion = pair.Item2; var distanceFromExplosion = Vector3.Distance(closestPointToExplosion, explosionPosition); var unclampedDamagePercent = (explosionRadius - distanceFromExplosion) / explosionRadius; var damagePercent = Mathf.Max(unclampedDamagePercent, 0); var damage = damagePercent * maxDamage; // TODO: don't call system directly var attackingPlayerObjectComponent = attackerPlayerId.HasValue ? PlayerObjectSystem.Instance.FindPlayerObjectComponent(attackerPlayerId.Value) : null; PlayerObjectSystem.Instance.ServerDamagePlayer( server, playerObjectComponent, damage, attackingPlayerObjectComponent ); // Apply forces. var rigidbody = playerObjectComponent.gameObject.GetComponent <Rigidbody>(); if (rigidbody != null) { rigidbody.AddExplosionForce(maxExplosionForce, explosionPosition, explosionRadius); } } for (var colliderIndex = 0; colliderIndex < affectedColliders.Length; colliderIndex++) { if (affectedColliderPlayerObjectComponents[colliderIndex] != null) { continue; } var collider = affectedColliders[colliderIndex]; // Apply forces. var rigidbody = collider.gameObject.GetComponent <Rigidbody>(); if (rigidbody != null) { rigidbody.AddExplosionForce(maxExplosionForce, explosionPosition, explosionRadius); } } }
/// <summary> /// Set DiveCount field</summary> /// <param name="diveCount_">Nullable field value to be set</param> public void SetDiveCount(uint?diveCount_) { SetFieldValue(49, 0, diveCount_, Fit.SubfieldIndexMainField); }
public NetworkBuilder SetMaxP2PVersion(uint version) { _maxP2PVersion = version; return(this); }