operator [] method

Score operator [](
  1. dynamic target
)

Implementation

Score operator [](dynamic target) {
  if (target is Entity) return Score(target, name, type: type);
  if (target is String) {
    return Score(Entity.PlayerName(target), name, type: type);
  }
  throw ('The operator [] just accepts Entity or String!');
}