// Implementation of Aspectual interface.
Implementation of Aspectual interface.
// Implementation of Aspectual interface .
func (r Entity) AddAspect(iface interface{}, imp Assertable) {
	k := reflect.ValueOf(reflect.TypeOf(iface).Elem()).Pointer()
	if v, ok := r[k]; ok {
		if v != imp {
			panic(errBound)
		}
	} else  {
		r[k] = imp;
		if a, ok := imp.(EntityAssignable); ok {
			a.NoteAssignedTo(r)
		}
	}
}
func ( r Entity ) AddAspect ( iface interface { } , imp Assertable ) { k := reflect . ValueOf ( reflect . TypeOf ( iface ) . Elem ( ) ) . Pointer ( ) if v , ok := r [ k ] ; ok { if v != imp { panic ( errBound ) } } else { r [ k ] = imp ; if a , ok := imp . ( EntityAssignable ) ; ok { a . NoteAssignedTo ( r ) } } }
Implementation of Aspectual interface.
Implementation of Aspectual interface .
// TODO Optimize using unsafe.