Selector.clone constructor

Selector.clone(
  1. Selector s
)

Copy a selector

Implementation

Selector.clone(Selector s) {
  List<Score>? scores;
  if (s.scores != null) {
    scores = [];
    for (var score in s.scores!) {
      scores.add(
        Score(score.entity, score.score,
            addNew: false, commands: score.commands),
      );
    }
  }

  selector = s.selector;
  playerName = s.playerName;
  limit = s.limit;
  tags = List<dynamic>.from(s.tags ?? []);
  team = s.team;
  scores = scores;
  nbt = gson.decode(gson.encode(s.nbt)) as Map<String, dynamic>;
  strNbt = s.strNbt;
  type = s.type;
  area = s.area;
  distance = s.distance;
  level = s.level;
  gamemode = s.gamemode;
  name = s.name;
  isRotated = s.isRotated;
  horizontalRotation = s.horizontalRotation;
  verticalRotation = s.verticalRotation;
  sorting = s.sorting;
  predicate = s.predicate;
}