// NewEntity creates and returns a new aspect-enabled entity instance.
// Supplied aspects are added to the new instance as implementing
// their respected interfaces. Aspects are notified about the assignment
// as described in EntityAssignable interface.
// Additionally, any supplied aspects that implement AspectExposing interface
// get attached as representing the additional returned interfaces.
NewEntity creates and returns a new aspect-enabled entity instance.
Supplied aspects are added to the new instance as implementing
their respected interfaces. Aspects are notified about the assignment
as described in EntityAssignable interface.
Additionally, any supplied aspects that implement AspectExposing interface
get attached as representing the additional returned interfaces.
// NewEntity creates and returns a new aspect - enabled entity instance . // Supplied aspects are added to the new instance as implementing // their respected interfaces . Aspects are notified about the assignment // as described in EntityAssignable interface . // Additionally any supplied aspects that implement AspectExposing interface // get attached as representing the additional returned interfaces .
func NewEntity(aspects ...Assertable) Entity {
	var res Entity = make(map[uintptr]interface{})
	for _, v := range aspects {
		res.AddAspect(v, v)
		if ae, ok := v.(AspectExposing); ok {
			l := ae.ExposedAspects()
			for _, a := range l {
				res.AddAspect(a, v)
			}
		}
	}
	return res
}
func NewEntity ( aspects ... Assertable ) Entity { var res Entity = make ( map [ uintptr ] interface { } ) for _ , v := range aspects { res . AddAspect ( v , v ) if ae , ok := v . ( AspectExposing ) ; ok { l := ae . ExposedAspects ( ) for _ , a := range l { res . AddAspect ( a , v ) } } } return res }
NewEntity creates and returns a new aspect-enabled entity instance.
NewEntity creates and returns a new aspect - enabled entity instance .