Ejemplo n.º 1
0
        protected override void HandleMessage(EntityActorMessageContext messageContext, DefaultEntityActorStateContainer state, ReinitializeEntityActorStatsMessage message)
        {
            EntityBaseStatsModel baseStats = GenerateEntityBaseStats(state.EntityGuid, state.EntityData);

            //TODO: Do base eventually. Right now we're only doing regular health fields since that's all we deal with clientside atm.
            state.EntityData.SetFieldValue(EntityObjectField.UNIT_FIELD_HEALTH, baseStats.BaseHealth);
            state.EntityData.SetFieldValue(EntityObjectField.UNIT_FIELD_MAXHEALTH, baseStats.BaseHealth);
        }
Ejemplo n.º 2
0
        private EntityBaseStatsModel GenerateEntityBaseStats([NotNull] NetworkEntityGuid entityGuid, [NotNull] IEntityDataFieldContainer data)
        {
            if (entityGuid == null)
            {
                throw new ArgumentNullException(nameof(entityGuid));
            }
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            //TODO: Replace base stats component.
            EntityBaseStatsModel baseStats = EntityBaseStatsFactory.Create(new EntityDataStatsDerivable(entityGuid.EntityType, data.GetFieldValue <int>(BaseObjectField.UNIT_FIELD_LEVEL)));

            return(baseStats);
        }