예제 #1
0
        public static void ShowEntity(this EntityComponent entityComponent, Type logicType, EntityData data)
        {
            if (data == null)
            {
                Log.Warning("Data is invalid.");
                return;
            }

            if (entityComponent.HasEntity(data.Id))
            {
                Log.Warning(string.Format("Entity {0} is exist.", data.Id));
                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),
                                       drEntity.Group, data);
        }
예제 #2
0
        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);
        }