Пример #1
0
        //TODO: Create a converter type
        private static ZoneServerNpcEntryModel BuildDatabaseNPCEntryToTransportNPC(NPCEntryModel npc)
        {
            NetworkEntityGuidBuilder guidBuilder = new NetworkEntityGuidBuilder();

            NetworkEntityGuid guid = guidBuilder.WithId(npc.EntryId)
                                     .WithType(EntityType.Npc)
                                     .Build();

            //TODO: Create a Vector3 converter
            return(new ZoneServerNpcEntryModel(guid, npc.NpcTemplateId, new Vector3(npc.SpawnPosition.X, npc.SpawnPosition.Y, npc.SpawnPosition.Z), npc.MovementType, npc.MovementData));
        }
        /// <inheritdoc />
        public Task UpdateAsync(int key, NPCEntryModel model)
        {
            GeneralGenericCrudRepositoryProvider <int, NPCEntryModel> crudProvider = new GeneralGenericCrudRepositoryProvider <int, NPCEntryModel>(Context.Entries, Context);

            return(crudProvider.UpdateAsync(key, model));
        }
        /// <inheritdoc />
        public Task <bool> TryCreateAsync(NPCEntryModel model)
        {
            var generalCrudProvider = BuildGeneralCrudProvider();

            return(generalCrudProvider.TryCreateAsync(model));
        }