1 /*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 #ifndef SCENE_SRC_ASSET_ASSET_OBJECT_H
16 #define SCENE_SRC_ASSET_ASSET_OBJECT_H
17
18 #include <ecs_serializer/intf_ecs_asset_manager.h>
19 #include <scene/interface/intf_scene.h>
20
21 #include <meta/ext/object.h>
22
SCENE_BEGIN_NAMESPACE()23 SCENE_BEGIN_NAMESPACE()
24
25 class IAssetObject : public CORE_NS::IInterface {
26 META_INTERFACE(CORE_NS::IInterface, IAssetObject, "70c77b11-bd85-490a-880f-d8a80d2addb0")
27 public:
28 virtual bool Load(const IScene::Ptr&, BASE_NS::string_view uri) = 0;
29 };
30
31 META_REGISTER_CLASS(AssetObject, "a8b4c9e9-9c28-49b7-85b2-2eb6ac812b7c", META_NS::ObjectCategoryBits::NO_CATEGORY)
32
33 class AssetObject : public META_NS::IntroduceInterfaces<META_NS::MetaObject, IAssetObject> {
34 META_OBJECT(AssetObject, SCENE_NS::ClassId::AssetObject, IntroduceInterfaces)
35
36 public:
37 bool Load(const IScene::Ptr&, BASE_NS::string_view uri) override;
38
39 private:
40 ECS_SERIALIZER_NS::IEntityCollection::Ptr entities_;
41 };
42
43 SCENE_END_NAMESPACE()
44
45 #endif
46