Vixen
c7401864
csharp
public sealed class PvpMatch

One PvP match: teams, objectives, score and the clock.

Read the guide page for this →

Remarks

⚠ A contested objective does not move in either direction. Not "the bigger group wins slowly" — frozen. The alternative makes numbers the whole game, and it makes standing on a point you already hold worth doing, which is how a battleground turns into everybody sitting still.

⚠ Score ticks for holding, and a capture pays once. Both, because they are different mechanics: resource control is won by holding more for longer, and a flag is won by taking it. A map uses whichever of the two numbers it sets.

⚠ The clock is checked after the score. A team that reaches the winning score on the same tick the clock runs out has won on score, not drawn — the same rule the dynamic-event director has, and the same reason: the work was done.

Fields and properties (8)

  • public PvpMap Map

    Which map.

  • public float Elapsed

    How long it has been running.

  • public int Round

    Which round it is on, counting from one.

  • public MatchOutcome Outcome

    How it ended, or Running.

  • public int Winner

    Which team won, or −1.

  • public bool IsOver

    Whether it is over.

  • public ReadOnlySpan<ObjectiveState> Objectives

    Its objectives' live state.

  • public IReadOnlyDictionary<PlayerId, int> Teams

    Everybody in it, and which team they are on.

Events (2)

  • public Action<ObjectiveState, int>? Captured

    Raised when an objective changes hands.

  • public Action<PvpMatch>? Ended

    Raised when the match ends.

Methods (9)

  • public PvpMatch(PvpMap map)

    Starts a match.

  • public int ScoreOf(int team)

    What a team has scored this round.

  • public int RoundsWonBy(int team)

    How many rounds a team has taken.

  • public int TeamOf(PlayerId player)

    Which team somebody is on, or −1.

  • public PvpRefusal Join(PlayerId player, int team)

    Puts somebody on a team.

  • public PvpRefusal Leave(PlayerId player)

    Takes somebody out, and forfeits the match when a team is emptied.

  • public PvpRefusal Occupy(int objective, ReadOnlySpan<int> present)

    Says how many of each team are standing on an objective.

  • public bool Tick(float delta)

    Advances the match.

  • public int Leader()

    Which team is ahead, or −1 when two are level.

Used by (1)

  • PvpMatchTestsVixen.Gameplay.Pvp.Tests