[swift-users] Checking/getting custom objects from a collection

Milos Rankovic milos at milos-and-slavica.net
Fri Apr 8 11:04:17 CDT 2016


> On 8 Apr 2016, at 15:12, Adriano Ferreira <adriano.ferreira at me.com> wrote:
> 
> Milos,
> 
> Thanks for taking a look at it, I appreciate you suggestion.
> 
> It’s protocol-oriented, quite different from the idea I was trying to emulate — the one provided by GameplayKit.
> 
> Well, I tried it and it works great.


Though you are very welcome, please note that I was merely implementing the target API you asked about. A better use of Swift’s protocols would be to declare various “component” conformances for each entity type, which answers the question, “does this type of entity have this feature in general”, leaving to the entity instances to answer the question, “what is the current state of this feature?”. In all, I’d definitely reconsider GameplayKit and the related advice.

milos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160408/26a75dbf/attachment.html>


More information about the swift-users mailing list