You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the if !ok check in the bottom of this snippet is inaccessible and therfore not required, due to the check for entity.tag.matches(tag) prior to it. I cannot come up with a situation in which the first tag check would pass but the attempt to get component data would fail. Is this correct? Code inserted below for your reference:
func (manager*Manager) fetchComponentsForEntity(entity*Entity, tagTag) map[*Component]interface{} {
if!entity.tag.matches(tag) {
returnnil
}
componentMap:=make(map[*Component]interface{})
for_, component:=rangemanager.components {
iftag.matches(component.tag) {
data, ok:=entity.GetComponentData(component)
if!ok {
returnnil// if one of the required components is not set, return nothing !
}```
The text was updated successfully, but these errors were encountered:
I believe the
if !ok
check in the bottom of this snippet is inaccessible and therfore not required, due to the check forentity.tag.matches(tag)
prior to it. I cannot come up with a situation in which the first tag check would pass but the attempt to get component data would fail. Is this correct? Code inserted below for your reference:The text was updated successfully, but these errors were encountered: