addConstraint method

bool addConstraint(
  1. ActorConstraint constraint
)

Implementation

bool addConstraint(ActorConstraint constraint) {
  _constraints ??= <ActorConstraint>[];
  if (_constraints!.contains(constraint)) {
    return false;
  }
  _constraints!.add(constraint);
  return true;
}