Exemple #1
0
        private void AddCreatureInstances([NotNull] IReadOnlyCollection <CreatureInstanceModel> resultEntries)
        {
            if (resultEntries == null)
            {
                throw new ArgumentNullException(nameof(resultEntries));
            }

            foreach (var instance in resultEntries)
            {
                if (Logger.IsInfoEnabled)
                {
                    Logger.Info($"Processing Creature Instance: {instance.Guid}");
                }

                CreatureInstanceMappable.Add(instance.Guid, instance);
            }
        }
Exemple #2
0
        private void CreateActor(WorldActorState state, CreateCreatureEntityActorMessage message)
        {
            //Create the actor and tell it to initialize.
            IActorRef actorRef = state.WorldActorFactory.ActorOf(Resolver.Create <DefaultCreatureEntityActor>(), message.EntityGuid.RawGuidValue.ToString());

            //TODO: Move to factory.
            CreatureInstanceModel instanceModel = CreatureInstanceMappable.RetrieveEntity(message.EntityGuid);
            CreatureTemplateModel templateModel = CreatureTemplateMappable.RetrieveEntity(message.EntityGuid);

            DefaultCreatureEntityActor.InitializeActor(actorRef, new DefaultCreatureActorState(EntityDataMappable.RetrieveEntity(message.EntityGuid), message.EntityGuid, instanceModel, templateModel, InterestMappable.RetrieveEntity(message.EntityGuid)));

            ActorRefMappable.AddObject(message.EntityGuid, actorRef);

            if (Logger.IsInfoEnabled)
            {
                Logger.Info($"Created Creature Actor: {typeof(DefaultCreatureEntityActor)} for Entity: {message.EntityGuid}");
            }
        }