My message bounced on account of size. I’m sorry if you receive multiple copies 
of this:

> “If Limb is a Component, then a Spider entity needs eight of them…”
That’s a fair question to ask. 

My intuition is that sporting a `Component` answers a question, “does it have 
this feature?” In the case of self-propelling creatures, you’d probably ask, 
“does it have legs”. On the other hand, asking, “does it (still) have a front 
left leg?” assumes that in general this entity has legs you can ask questions 
about. All of which would suggest that `SpiderLegs` component would be 
sufficient for most spider games…

As for the `add` and `remove` methods, I’d probably also return the removed 
component (if any):

        mutating func remove<T: Component>(_: T.Type) -> T? {
                return components.removeValueForKey(T.name) as? T
        }

milos
> On 8 Apr 2016, at 15:30, Adriano Ferreira <adriano.ferre...@me.com> wrote:
> 
> Hi Milos,
> 
> Thanks for getting back to me this quickly.
> 
> Well, this part specifically was more of a curiosity based on Jens’ comment:
> 
> “If Limb is a Component, then a Spider entity needs eight of them…”
> 
> I also confess I’m unsure about this… so please don’t bother then.
> 
> Looking forward to hearing your thoughts on the functions though.
> 
> Cheers,
> 
> — A

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to