This commit is contained in:
Tassilo Schweyer 2026-06-08 12:26:13 +02:00
parent cabfdd4252
commit fb77d13eb5
15 changed files with 447 additions and 3 deletions

View file

@ -0,0 +1,44 @@
/*
* Copyright (C) 2026 welterde
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.welterde.em.w;
import de.welterde.em.data.Location;
import de.welterde.em.data.TerrainGen;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
*
* @author welterde
*/
public class Area {
protected final int id;
protected final ReadWriteLock structLock;
protected final AreaMap map;
protected final Map<Integer, Location> locations;
public Area(int id, TerrainGen gen) {
this.id = id;
this.structLock = new ReentrantReadWriteLock();
this.map = new AreaMap(gen);
this.locations = new HashMap<>();
}
}