private Action <IModel> SendMessageOnChannel <T>(T message, string routingKey, Action <IBasicProperties> propertiesSetter = null) { return(channel => RabbitSendMessage( channel, _serializer(message), UpdateProperties(propertiesSetter)(channel), routingKey)); }
public FrmMapProperties() { InitializeComponent(); UpdatePropertiesDelegate = Update; this.Icon = Properties.Resources.Icon; }
protected void PushPropertyUpdates() { UpdateProperties packet; IPayloadSerializer serializer; lock (_sync) { if (_pendingUpdates.Count == 0 || _Context.All.Clients.Count == 0) { return; } serializer = _Context.Host.Serializer; packet = new UpdateProperties { Updates = new List <PropertyData>(_pendingUpdates.Count), Eid = _Eid }; foreach (var prop in _pendingUpdates) { if (prop.IsPushed) { continue; } UpdateProperty(prop, true); packet.Updates.Add(prop.Data); } _pendingUpdates.Clear(); } _Context.All.Send(packet); }
/// <summary> /// Constructs a update clause of form <code>ColumnName=@PropertyName, ...</code> with all the updateable columns (e.g. /// <code>EmployeeId=@EmployeeId,DeskNo=@DeskNo</code>) /// </summary> /// <param name="tableAlias">Optional table alias.</param> protected virtual string ConstructUpdateClauseInternal(string tableAlias = null) { return(string.Join(",", UpdateProperties.Select( propInfo => $"{GetColumnName(propInfo, tableAlias, false)}={ParameterPrefix + propInfo.PropertyName}"))); }
private object OnUpdateProperties(IConnection connection, UpdateProperties payload) { if (payload != null && LocalInstances.TryGetValue(payload.Eid, out var instance)) { instance.UpdateProperties(connection, payload); } return(null); }
protected UpdateProperties GetAllProperties(IConnection con) { lock (_sync) { var packet = new UpdateProperties { Updates = new List <PropertyData>(_Descriptor.Properties.Count), Eid = _Eid }; foreach (var prop in _cache) { packet.Updates.Add(prop.Value.Data); } return(packet); } }
public void Start() { if (!this.properties.isInitialized) { this.properties.isInitialized = true; this.properties.maxHealth = 3; this.properties.currentHealth = this.properties.maxHealth; this.properties.mouseTargetPosition = -9999 * Vector3.one; this.properties.oldMouseTargetPosition = this.properties.mouseTargetPosition; this.properties.enemyHitTargetPosition = this.properties.mouseTargetPosition; this.properties.oldEnemyHitTargetPosition = this.properties.enemyHitTargetPosition; this.properties.enemySeenTargetPosition = this.properties.mouseTargetPosition; this.properties.oldEnemySeenTargetPosition = this.properties.enemySeenTargetPosition; this.properties.scalingFactor = 1.4f; this.properties.level = 1; this.properties.isSelected = false; this.properties.isCommanded = false; this.properties.isAttackCooldownEnabled = false; this.properties.isRecoveryEnabled = false; this.properties.isMerging = false; this.properties.isSplitting = false; this.properties.targetUnit = null; } this.updateProperties += NewProperty; NewSelectionRing[] selectionRings = this.GetComponentsInChildren <NewSelectionRing>(true); foreach (NewSelectionRing ring in selectionRings) { if (ring != null) { this.selectionRing = ring.gameObject; break; } else { Debug.LogError("Cannot find mesh filter and/or mesh renderer for unit's selection ring."); } } this.agent = this.GetComponent <NavMeshAgent>(); if (this.agent == null) { Debug.LogError("Cannot obtain nav mesh agent from game unit."); } this.recoveryCounter = 0f; this.attackCooldownCounter = 0f; this.takeDamageCounter = 0f; this.isDead = false; //NOTE(Thompson): Changing the name here, so I can really get rid of (Clone). this.name = "NewGameUnit"; }
public FrmMapProperties() { InitializeComponent(); UpdatePropertiesDelegate = Update; }
public void Start() { if (!this.properties.isInitialized) { this.properties.isInitialized = true; this.properties.maxHealth = 3; this.properties.currentHealth = this.properties.maxHealth; this.properties.mouseTargetPosition = -9999 * Vector3.one; this.properties.oldMouseTargetPosition = this.properties.mouseTargetPosition; this.properties.enemyHitTargetPosition = this.properties.mouseTargetPosition; this.properties.oldEnemyHitTargetPosition = this.properties.enemyHitTargetPosition; this.properties.enemySeenTargetPosition = this.properties.mouseTargetPosition; this.properties.oldEnemySeenTargetPosition = this.properties.enemySeenTargetPosition; this.properties.scalingFactor = 1.4f; this.properties.level = 1; this.properties.isSelected = false; this.properties.isCommanded = false; this.properties.isAttackCooldownEnabled = false; this.properties.isRecoveryEnabled = false; this.properties.isMerging = false; this.properties.isSplitting = false; this.properties.targetUnit = null; } this.updateProperties += NewProperty; NewSelectionRing[] selectionRings = this.GetComponentsInChildren<NewSelectionRing>(true); foreach (NewSelectionRing ring in selectionRings) { if (ring != null) { this.selectionRing = ring.gameObject; break; } else { Debug.LogError("Cannot find mesh filter and/or mesh renderer for unit's selection ring."); } } this.agent = this.GetComponent<NavMeshAgent>(); if (this.agent == null) { Debug.LogError("Cannot obtain nav mesh agent from game unit."); } this.recoveryCounter = 0f; this.attackCooldownCounter = 0f; this.takeDamageCounter = 0f; this.isDead = false; //NOTE(Thompson): Changing the name here, so I can really get rid of (Clone). this.name = "NewGameUnit"; }