001package com.fs.starfarer.api.util; 002 003import java.util.Map; 004 005import com.fs.starfarer.api.combat.MutableStat; 006import com.fs.starfarer.api.combat.StatBonus; 007 008/** 009 * Mutable stats that are created on-demand when they're needed, unlike 010 * the "standard" stats that have to be hardcoded. 011 * 012 * Intended to be useful for stuff like the interactions between terrain, 013 * hull mod effects, and character skills. It's desirable for them to be 014 * able to affect each other, but since all can be modded in from scratch, 015 * it's hard to rely on the hardcoded stat set. 016 * 017 * @author Alex Mosolov 018 * 019 * Copyright 2015 Fractal Softworks, LLC 020 */ 021public interface DynamicStatsAPI { 022 023 /** 024 * Base value of the stat is 1. 025 * @param id 026 * @return 027 */ 028 MutableStat getStat(String id); 029 030 /** 031 * Base value of the stat is 1. 032 * @param id 033 * @return 034 */ 035 float getValue(String id); 036 037 038 StatBonus getMod(String id); 039 float getValue(String id, float base); 040 041 042 void removeUmodified(); 043 044 Map<String, MutableStat> getStats(); 045 Map<String, StatBonus> getMods(); 046 047 048 boolean isEmpty(); 049 050}