Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/parametric object #547

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Feat/parametric object #547

wants to merge 2 commits into from

Conversation

kyasbal
Copy link
Member

@kyasbal kyasbal commented Dec 26, 2017

GeometryやMaterialなど、コンポーネントではないが、コンポーネントに動的な値を持つ集合として扱わせたいもの。

  • ownerはattachされたコンポーネント。attachできるコンポーネントは一つだけ

  • attachParametricObjectでは、すでにownerがあった場合例外

  • getAttributeDeclarationsでは、そのParametricObjectが持つ属性への定義か、こ要素となるIParametricObjectへの参照が代入される

  • attachParametricObjectではbaseNameを名前空間に考慮して入れる。${LIB_NAMESPACE}.${COMPONENT}.${BASENAME}.${ATTR_NAME}

    interface IParametricObject{
    owner?:Component;
    getAttributeDeclarations():{[key:string]:IAttributeDeclaration|IParametricObject};
    onAttachComponent(component:Component,ctx:ParametricObjectContext):void;
    onDetachComponent(lastComponent:Component,ctx:ParametricObjectContext):void;
    }

  • Component#__attachParametricObject(obj:IParametricObject,baseName:string)

  • Component#__detachParametricObject(baseName:string);

  • ParametricObjectContext#bindTo()

  • ParametricObjectContext#watch()

  • ParametricObjectContext#getAttributeRaw

@kyasbal kyasbal requested a review from moajo December 26, 2017 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant