/* * Copyright (C) 2015 The 8-Bit Bunch. Licensed under the Apache License, Version 1.1 * (the "License"); you may not use this file except in compliance with the License. * You may obtain a copy of the License at . * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF * ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.badvision.outlaweditor.data; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Set; import org.badvision.outlaweditor.api.ApplicationState; import org.badvision.outlaweditor.api.Platform; import org.badvision.outlaweditor.data.xml.Map; import org.badvision.outlaweditor.data.xml.Map.Chunk; import org.badvision.outlaweditor.data.xml.ObjectFactory; import org.badvision.outlaweditor.data.xml.Script; import org.badvision.outlaweditor.data.xml.Script.LocationTrigger; import org.badvision.outlaweditor.data.xml.Scripts; import org.badvision.outlaweditor.data.xml.Tile; import org.badvision.outlaweditor.ui.UIAction; import jakarta.xml.bind.JAXBElement; import javafx.scene.control.Alert; import javafx.scene.image.WritableImage; import javafx.scene.paint.Color; /** * * @author brobert */ public class TileMap extends ArrayList> implements Serializable { public static final long serialVersionUID = 6486309334559843742L; Map backingMap; boolean backingMapStale; int width; int height; public TileMap(Map m) { backingMapStale = false; width = 0; height = 0; loadFromMap(m); } public static final double SATURATION = 0.70; public static final double VALUE = 1.0; public static double HUE = 180; private final java.util.Map> locationScripts = new HashMap<>(); private final java.util.Map scriptColors = new HashMap<>(); public Optional getScriptColor(Script s) { return Optional.ofNullable(scriptColors.get(s)); } public List