Skip to content

Improve abstraction for "plots" #10

@zyuiop

Description

@zyuiop

The different kind of "claims" should all depend on a single interface, exposing multiple methods, like
canBuild(player), canInteract(player), ...

A general registry should return top level region AND lowest level region for each point of the map, instead of having to recursively search each region manager, in a single method (like getRegionHere(coords) or a more specific getPlotHere(coords). The first one should return a singleton Wilderness region allowing every one to build.

The scoreboard "city" display could be moved to the new general registry as well.

Questions still to consider: how to handle composite regions (i.e. cities or future regions).

-> When a player wants to build, we only need to check if he or can't build but don't care of the actual region --> composite regions should check if a child region handles
-> When we need to find the tree of claims, each claim should return its children the same way.

As most of claims will in the end be composite claims (even plots, as we may introduce "rental subplots"), we clearly can add the method getChildren directly in the interface.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions