Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

EitherType is not great, let's make it more clear #113

Merged
merged 2 commits into from
Mar 6, 2017
Merged

Conversation

modjke
Copy link
Contributor

@modjke modjke commented Mar 6, 2017

This one #111 got me thinking, EitherType for class members are not that great, let's explictly subtype all the shapes with 'virtual' base class: Shape.
It provides a convinient way of type checking:
shape.type == RECT or switch (shape.type) { ... }
and you can call a basic method contains(x,y) without knowing the exact shape type.

@adireddy

This comment was marked as spam.

@adireddy adireddy merged commit d81320f into pixijs:dev Mar 6, 2017
@IkonOne
Copy link
Contributor

IkonOne commented Mar 7, 2017

Thanks guys. I'll be using this now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants