Exemple #1
0
        private static void ShowEntity(this EntityComponent entityComponent, Type logicType, string entityGroup, int priority, int entityId = -1)
        {
            IDataTable <DREntity> dtEntity = GameEntry.DataTable.GetDataTable <DREntity>();
            DREntity drEntity = dtEntity.GetDataRow(entityId);

            if (drEntity == null)
            {
                Log.Warning("Can not load entity id '{0}' from data table.", entityId);
                return;
            }

            entityComponent.ShowEntity(GenerateSerialId(entityComponent), logicType, AssetUtility.GetEntityAsset(drEntity.AssetName), entityGroup, priority);
        }
        private static void ShowEntity(this EntityComponent entityComponent, Type logicType, string entityGroup, int priority, EntityData data)
        {
            if (data == null)
            {
                Log.Warning("Data is invalid.");
                return;
            }

            IDataTable <DREntity> dtEntity = GameEntry.DataTable.GetDataTable <DREntity>();
            DREntity drEntity = dtEntity.GetDataRow(data.TypeId);

            if (drEntity == null)
            {
                Log.Warning("Can not load entity id '{0}' from data table.", data.TypeId.ToString());
                return;
            }

            entityComponent.ShowEntity(data.Id, logicType, AssetUtility.GetEntityAsset(drEntity.AssetName), entityGroup, priority, data);
        }