initial
This commit is contained in:
commit
cabfdd4252
41 changed files with 1335 additions and 0 deletions
18
nb-configuration.xml
Normal file
18
nb-configuration.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project-shared-configuration>
|
||||||
|
<!--
|
||||||
|
This file contains additional configuration written by modules in the NetBeans IDE.
|
||||||
|
The configuration is intended to be shared among all the users of project and
|
||||||
|
therefore it is assumed to be part of version control checkout.
|
||||||
|
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
||||||
|
-->
|
||||||
|
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
||||||
|
<!--
|
||||||
|
Properties that influence various parts of the IDE, especially code formatting and the like.
|
||||||
|
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
||||||
|
That way multiple projects can share the same settings (useful for formatting rules for example).
|
||||||
|
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
||||||
|
-->
|
||||||
|
<netbeans.hint.license>gpl30</netbeans.hint.license>
|
||||||
|
</properties>
|
||||||
|
</project-shared-configuration>
|
||||||
37
pom.xml
Normal file
37
pom.xml
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>de.welterde.em</groupId>
|
||||||
|
<artifactId>exotic_matter</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.release>25</maven.compiler.release>
|
||||||
|
<exec.mainClass>de.welterde.em.Exotic_matter</exec.mainClass>
|
||||||
|
</properties>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
<id>central</id>
|
||||||
|
<name>Maven Repository Switchboard</name>
|
||||||
|
<url>https://repo1.maven.org/maven2</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<pluginRepositories>
|
||||||
|
|
||||||
|
<pluginRepository>
|
||||||
|
<releases>
|
||||||
|
<updatePolicy>never</updatePolicy>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
<id>central</id>
|
||||||
|
<name>Maven Plugin Repository</name>
|
||||||
|
<url>https://repo1.maven.org/maven2</url>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
</project>
|
||||||
41
src/main/java/de/welterde/em/CollisionException.java
Normal file
41
src/main/java/de/welterde/em/CollisionException.java
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class CollisionException extends RuntimeException {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of <code>CollisionException</code> without detail
|
||||||
|
* message.
|
||||||
|
*/
|
||||||
|
public CollisionException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance of <code>CollisionException</code> with the
|
||||||
|
* specified detail message.
|
||||||
|
*
|
||||||
|
* @param msg the detail message.
|
||||||
|
*/
|
||||||
|
public CollisionException(String msg) {
|
||||||
|
super(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
16
src/main/java/de/welterde/em/Exotic_matter.java
Normal file
16
src/main/java/de/welterde/em/Exotic_matter.java
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.welterde.em;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class Exotic_matter {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("Hello World!");
|
||||||
|
}
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/data/BuildingManager.java
Normal file
25
src/main/java/de/welterde/em/data/BuildingManager.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manage presence of rooms, walls, corridors, etc.
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class BuildingManager {
|
||||||
|
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/data/CoordVector.java
Normal file
25
src/main/java/de/welterde/em/data/CoordVector.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public record CoordVector(short dz, short dx, short dy) {
|
||||||
|
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/data/Corridor.java
Normal file
25
src/main/java/de/welterde/em/data/Corridor.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public final class Corridor extends LocationBase implements Location {
|
||||||
|
|
||||||
|
}
|
||||||
26
src/main/java/de/welterde/em/data/CounterName.java
Normal file
26
src/main/java/de/welterde/em/data/CounterName.java
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public enum CounterName {
|
||||||
|
LOCATION_IDX,
|
||||||
|
ENTITY_IDX,
|
||||||
|
}
|
||||||
48
src/main/java/de/welterde/em/data/Direction.java
Normal file
48
src/main/java/de/welterde/em/data/Direction.java
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public enum Direction {
|
||||||
|
EAST,
|
||||||
|
WEST,
|
||||||
|
NORTH,
|
||||||
|
SOUTH,
|
||||||
|
UP,
|
||||||
|
DOWN;
|
||||||
|
|
||||||
|
public static final CoordVector EAST_VEC = new CoordVector((short) 0, (short) 1, (short) 0);
|
||||||
|
public static final CoordVector WEST_VEC = new CoordVector((short) 0, (short) -1, (short) 0);
|
||||||
|
public static final CoordVector NORTH_VEC = new CoordVector((short) 0, (short) 0, (short) 1);
|
||||||
|
public static final CoordVector SOUTH_VEC = new CoordVector((short) 0, (short) 0, (short) -1);
|
||||||
|
public static final CoordVector UP_VEC = new CoordVector((short) 1, (short) 0, (short) 0);
|
||||||
|
public static final CoordVector DOWN_VEC = new CoordVector((short) -1, (short) 0, (short) 0);
|
||||||
|
|
||||||
|
public CoordVector getNormVector() {
|
||||||
|
return switch(this) {
|
||||||
|
case EAST -> EAST_VEC;
|
||||||
|
case WEST -> WEST_VEC;
|
||||||
|
case NORTH -> NORTH_VEC;
|
||||||
|
case SOUTH -> SOUTH_VEC;
|
||||||
|
case UP -> UP_VEC;
|
||||||
|
case DOWN -> DOWN_VEC;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
43
src/main/java/de/welterde/em/data/Entity.java
Normal file
43
src/main/java/de/welterde/em/data/Entity.java
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public interface Entity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Space occupied by entity.
|
||||||
|
* In case of small object with no bounding box return null.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Object getBoundingBox();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get current location of object.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Location getLocation();
|
||||||
|
|
||||||
|
public boolean isMovable();
|
||||||
|
|
||||||
|
public MovementStatus getMovementStatus();
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/data/EntityBase.java
Normal file
25
src/main/java/de/welterde/em/data/EntityBase.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public abstract class EntityBase implements Entity {
|
||||||
|
|
||||||
|
}
|
||||||
34
src/main/java/de/welterde/em/data/EntityPosMgr.java
Normal file
34
src/main/java/de/welterde/em/data/EntityPosMgr.java
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manages position and occupied tiles by entities
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class EntityPosMgr {
|
||||||
|
protected final OutpostMap ctx;
|
||||||
|
|
||||||
|
public EntityPosMgr(OutpostMap ctx) {
|
||||||
|
this.ctx = ctx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void occupyTile(Tile t, Entity e) {
|
||||||
|
// do something
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/main/java/de/welterde/em/data/EntityType.java
Normal file
30
src/main/java/de/welterde/em/data/EntityType.java
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public enum EntityType {
|
||||||
|
|
||||||
|
SMALL_ITEM,
|
||||||
|
LARGE_ITEM,
|
||||||
|
|
||||||
|
MACHINERY,
|
||||||
|
FURNITURE,
|
||||||
|
}
|
||||||
26
src/main/java/de/welterde/em/data/Location.java
Normal file
26
src/main/java/de/welterde/em/data/Location.java
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public sealed interface Location permits LocationBase, Corridor, Room {
|
||||||
|
public short getSecurityLevel();
|
||||||
|
public Location setSecurityLevel(short newLevel);
|
||||||
|
}
|
||||||
37
src/main/java/de/welterde/em/data/LocationBase.java
Normal file
37
src/main/java/de/welterde/em/data/LocationBase.java
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public abstract class LocationBase implements Location {
|
||||||
|
|
||||||
|
protected short securityLevel;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public short getSecurityLevel() {
|
||||||
|
return this.securityLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Location setSecurityLevel(short newLevel) {
|
||||||
|
this.securityLevel = newLevel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
34
src/main/java/de/welterde/em/data/LocationManager.java
Normal file
34
src/main/java/de/welterde/em/data/LocationManager.java
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manages locations like rooms, corridors, sectors
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class LocationManager {
|
||||||
|
protected final OutpostMap ctx;
|
||||||
|
|
||||||
|
public LocationManager(OutpostMap ctx) {
|
||||||
|
this.ctx = ctx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Corridor buildCorridor(MapCoord startPos, Direction dir, short width, short height) {
|
||||||
|
var vec = dir.getNormVector();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
44
src/main/java/de/welterde/em/data/MapCoord.java
Normal file
44
src/main/java/de/welterde/em/data/MapCoord.java
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Record.java to edit this template
|
||||||
|
*/
|
||||||
|
package de.welterde.em.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* z coordinate goes from 65km to 0, where ground-level is at 50km
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public record MapCoord(int z, int x, int y) {
|
||||||
|
|
||||||
|
public MapCoord move(Direction dir) {
|
||||||
|
switch (dir) {
|
||||||
|
case EAST -> {
|
||||||
|
return new MapCoord(z, x + 1, y);
|
||||||
|
}
|
||||||
|
case WEST -> {
|
||||||
|
return new MapCoord(z, x - 1, y);
|
||||||
|
}
|
||||||
|
case NORTH -> {
|
||||||
|
return new MapCoord(z, x, y + 1);
|
||||||
|
}
|
||||||
|
case SOUTH -> {
|
||||||
|
return new MapCoord(z, x, y - 1);
|
||||||
|
}
|
||||||
|
case UP -> {
|
||||||
|
return new MapCoord(z - 1, x, y);
|
||||||
|
}
|
||||||
|
case DOWN -> {
|
||||||
|
return new MapCoord(z + 1, x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUnderground() {
|
||||||
|
return (z < 50000);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MapCoord add(CoordVector v) {
|
||||||
|
return new MapCoord(z + v.dz(), x + v.dx(), y + v.dy());
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/main/java/de/welterde/em/data/MovementStatus.java
Normal file
30
src/main/java/de/welterde/em/data/MovementStatus.java
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public enum MovementStatus {
|
||||||
|
/**
|
||||||
|
* Entity is fixed in place
|
||||||
|
*/
|
||||||
|
FIXED,
|
||||||
|
STATIONARY,
|
||||||
|
MOVING
|
||||||
|
}
|
||||||
57
src/main/java/de/welterde/em/data/OutpostMap.java
Normal file
57
src/main/java/de/welterde/em/data/OutpostMap.java
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||||
|
*/
|
||||||
|
package de.welterde.em.data;
|
||||||
|
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class OutpostMap {
|
||||||
|
|
||||||
|
protected final Map<MapCoord,Tile> tiles;
|
||||||
|
protected final Map<Integer, Location> locations;
|
||||||
|
protected final Map<Integer, Entity> entities;
|
||||||
|
protected final EntityPosMgr entityPosMgr;
|
||||||
|
protected final TerrainGen gen;
|
||||||
|
protected final EnumMap<CounterName, Integer> counters;
|
||||||
|
|
||||||
|
public OutpostMap(TerrainGen gen) {
|
||||||
|
this.tiles = new HashMap<>();
|
||||||
|
this.locations = new HashMap<>();
|
||||||
|
this.entities = new HashMap<>();
|
||||||
|
this.counters = new EnumMap<>(CounterName.class);
|
||||||
|
this.gen = gen;
|
||||||
|
this.entityPosMgr = new EntityPosMgr(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tile getTile(MapCoord c) {
|
||||||
|
if(!this.tiles.containsKey(c)) {
|
||||||
|
// default to the terrain generator
|
||||||
|
return this.gen.generateTile(this, c);
|
||||||
|
} else {
|
||||||
|
return this.tiles.get(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateTile(MapCoord c, Tile upd) {
|
||||||
|
this.tiles.put(c, upd);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int incrCounter(CounterName n) {
|
||||||
|
synchronized(this.counters) {
|
||||||
|
var nextVal = this.counters.get(n) + 1;
|
||||||
|
this.counters.put(n, nextVal);
|
||||||
|
return nextVal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void occupyTile(Tile t, Entity e) {
|
||||||
|
this.entityPosMgr.occupyTile(t, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/data/Room.java
Normal file
25
src/main/java/de/welterde/em/data/Room.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public final class Room extends LocationBase implements Location {
|
||||||
|
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/data/RoomCoord.java
Normal file
25
src/main/java/de/welterde/em/data/RoomCoord.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public record RoomCoord(short sector, short level, short corridor, short room) {
|
||||||
|
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/data/TerrainGen.java
Normal file
25
src/main/java/de/welterde/em/data/TerrainGen.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public interface TerrainGen<X> {
|
||||||
|
public Tile generateTile(X ctx, MapCoord c);
|
||||||
|
}
|
||||||
47
src/main/java/de/welterde/em/data/Tile.java
Normal file
47
src/main/java/de/welterde/em/data/Tile.java
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public interface Tile {
|
||||||
|
public TileType getType();
|
||||||
|
|
||||||
|
// get Room/Corridor/.. if there is any
|
||||||
|
public Location getLocation();
|
||||||
|
|
||||||
|
public Tile setLocation(Location loc);
|
||||||
|
|
||||||
|
// get next tile in specified direction
|
||||||
|
public Tile next(Direction dir);
|
||||||
|
|
||||||
|
public boolean isWalkable();
|
||||||
|
|
||||||
|
public boolean isBuildable();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get entity occupying this tile if there is any
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Entity getEntity();
|
||||||
|
|
||||||
|
public Tile occupy(Entity e);
|
||||||
|
|
||||||
|
}
|
||||||
83
src/main/java/de/welterde/em/data/TileImpl.java
Normal file
83
src/main/java/de/welterde/em/data/TileImpl.java
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
import de.welterde.em.CollisionException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public record TileImpl(OutpostMap ctx, MapCoord coord, TileType type, Location location, Entity occupator) implements Tile {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileType getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Location getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Tile setLocation(Location newLocation) {
|
||||||
|
Tile upd = new TileImpl(ctx, coord, type, newLocation, occupator);
|
||||||
|
ctx.updateTile(coord, upd);
|
||||||
|
return upd;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Tile next(Direction dir) {
|
||||||
|
var nextCoord = coord.move(dir);
|
||||||
|
return this.ctx.getTile(nextCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isWalkable() {
|
||||||
|
// this tile needs to be empty, the tile above needs to be empty
|
||||||
|
// and tile below needs to be solid
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBuildable() {
|
||||||
|
// only check if this tile is available for building
|
||||||
|
// check if it is occupied already
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Entity getEntity() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Tile occupy(Entity e) {
|
||||||
|
// if we are already occupied..
|
||||||
|
if(this.getEntity() != null)
|
||||||
|
throw new CollisionException();
|
||||||
|
|
||||||
|
// in case object is fixed we will remember that
|
||||||
|
if(!e.isMovable()) {
|
||||||
|
Tile upd = new TileImpl(ctx, coord, type, location, e);
|
||||||
|
ctx.updateTile(coord, upd);
|
||||||
|
return upd;
|
||||||
|
} else {
|
||||||
|
ctx.occupyTile(this, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
src/main/java/de/welterde/em/data/TileType.java
Normal file
32
src/main/java/de/welterde/em/data/TileType.java
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* 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.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public enum TileType {
|
||||||
|
// tile is fully filed with some material
|
||||||
|
FILLED,
|
||||||
|
// tile is fully unfilled/uninvolved
|
||||||
|
AIR,
|
||||||
|
CORRIDOR,
|
||||||
|
ROOM,
|
||||||
|
WALL,
|
||||||
|
DOOR,
|
||||||
|
}
|
||||||
42
src/main/java/de/welterde/em/data/gen/BasicTerrainGen.java
Normal file
42
src/main/java/de/welterde/em/data/gen/BasicTerrainGen.java
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* 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.data.gen;
|
||||||
|
|
||||||
|
import de.welterde.em.data.MapCoord;
|
||||||
|
import de.welterde.em.data.OutpostMap;
|
||||||
|
import de.welterde.em.data.TerrainGen;
|
||||||
|
import de.welterde.em.data.Tile;
|
||||||
|
import de.welterde.em.data.TileImpl;
|
||||||
|
import de.welterde.em.data.TileType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class BasicTerrainGen implements TerrainGen<OutpostMap> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Tile generateTile(OutpostMap ctx, MapCoord c) {
|
||||||
|
if(c.isUnderground()) {
|
||||||
|
// generate tile with filled material
|
||||||
|
return new TileImpl(ctx, c, TileType.FILLED, null, null);
|
||||||
|
} else {
|
||||||
|
return new TileImpl(ctx, c, TileType.AIR, null, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/data/gen/OutpostGen.java
Normal file
25
src/main/java/de/welterde/em/data/gen/OutpostGen.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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.data.gen;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class OutpostGen {
|
||||||
|
|
||||||
|
}
|
||||||
30
src/main/java/de/welterde/em/e/Employee.java
Normal file
30
src/main/java/de/welterde/em/e/Employee.java
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* 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.e;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class Employee {
|
||||||
|
protected String name;
|
||||||
|
|
||||||
|
|
||||||
|
public Employee(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/e/Skill.java
Normal file
25
src/main/java/de/welterde/em/e/Skill.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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.e;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public interface Skill {
|
||||||
|
|
||||||
|
}
|
||||||
32
src/main/java/de/welterde/em/entity/EntityManager.java
Normal file
32
src/main/java/de/welterde/em/entity/EntityManager.java
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* 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.entity;
|
||||||
|
|
||||||
|
import de.welterde.em.data.OutpostMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class EntityManager {
|
||||||
|
|
||||||
|
protected final OutpostMap ctx;
|
||||||
|
|
||||||
|
public EntityManager(OutpostMap ctx) {
|
||||||
|
this.ctx = ctx;
|
||||||
|
}
|
||||||
|
}
|
||||||
27
src/main/java/de/welterde/em/entity/ItemBase.java
Normal file
27
src/main/java/de/welterde/em/entity/ItemBase.java
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* 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.entity;
|
||||||
|
|
||||||
|
import de.welterde.em.data.Entity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public abstract class ItemBase implements Entity {
|
||||||
|
|
||||||
|
}
|
||||||
27
src/main/java/de/welterde/em/room/RoomType.java
Normal file
27
src/main/java/de/welterde/em/room/RoomType.java
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* 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.room;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public enum RoomType {
|
||||||
|
LAB,
|
||||||
|
OFFICE,
|
||||||
|
COMPUTER_ROOM,
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/w/City.java
Normal file
25
src/main/java/de/welterde/em/w/City.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class City {
|
||||||
|
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/w/Country.java
Normal file
25
src/main/java/de/welterde/em/w/Country.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class Country {
|
||||||
|
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/w/Dimension.java
Normal file
25
src/main/java/de/welterde/em/w/Dimension.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class Dimension {
|
||||||
|
|
||||||
|
}
|
||||||
32
src/main/java/de/welterde/em/w/DimensionType.java
Normal file
32
src/main/java/de/welterde/em/w/DimensionType.java
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public enum DimensionType {
|
||||||
|
/**
|
||||||
|
* Our dimension or other dimension with nor particular features
|
||||||
|
*/
|
||||||
|
BASE,
|
||||||
|
/**
|
||||||
|
* Endless backrooms
|
||||||
|
*/
|
||||||
|
BACKROOMS,
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/w/Org.java
Normal file
25
src/main/java/de/welterde/em/w/Org.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Organization
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class Org {
|
||||||
|
|
||||||
|
}
|
||||||
31
src/main/java/de/welterde/em/w/Outpost.java
Normal file
31
src/main/java/de/welterde/em/w/Outpost.java
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* 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 java.util.EnumSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class Outpost {
|
||||||
|
protected final EnumSet<OutpostFlags> flags;
|
||||||
|
|
||||||
|
public Outpost() {
|
||||||
|
this.flags = EnumSet.noneOf(OutpostFlags.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
41
src/main/java/de/welterde/em/w/OutpostFlags.java
Normal file
41
src/main/java/de/welterde/em/w/OutpostFlags.java
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public enum OutpostFlags {
|
||||||
|
/**
|
||||||
|
* Traffic connection via rail
|
||||||
|
*/
|
||||||
|
RAIL_CONNECTION,
|
||||||
|
BOAT_CONNECTION,
|
||||||
|
ROAD_CONNECTION,
|
||||||
|
AIR_CONNECTION,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* receives mail service from government
|
||||||
|
*/
|
||||||
|
MAIL_SERVICE,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Has outside connection for utilities like water, sewage, electricity
|
||||||
|
*/
|
||||||
|
UTILITIES_CONNECTION;
|
||||||
|
}
|
||||||
40
src/main/java/de/welterde/em/w/OutpostLocationType.java
Normal file
40
src/main/java/de/welterde/em/w/OutpostLocationType.java
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public enum OutpostLocationType {
|
||||||
|
INNER_CITY,
|
||||||
|
CITY_RESEARCH_PARK,
|
||||||
|
VILLAGE,
|
||||||
|
REMOTE_DESERT,
|
||||||
|
REMOTE_WOODS,
|
||||||
|
REMOTE_MOUNTAIN,
|
||||||
|
REMOTE_UNDERSEA;
|
||||||
|
|
||||||
|
public boolean nearPopulationCenter() {
|
||||||
|
return switch (this) {
|
||||||
|
case INNER_CITY, CITY_RESEARCH_PARK, VILLAGE ->
|
||||||
|
true;
|
||||||
|
default ->
|
||||||
|
false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
25
src/main/java/de/welterde/em/w/World.java
Normal file
25
src/main/java/de/welterde/em/w/World.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author welterde
|
||||||
|
*/
|
||||||
|
public class World {
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue