private Trigger(ETileScope p_scope, ETileWhen p_when, TileType p_type, Effect p_effect) { m_type = p_type; m_scope = p_scope; m_when = p_when; m_effect = p_effect; }
public static Trigger LoadFromJson(JSONClass p_json) { try { TileType tile_type = TileType.LoadFromValue(Util.getValue <string> (p_json, "type")); ETileScope scope = Util.parseEnum <ETileScope> (Util.getValue <string> (p_json, "scope")); ETileWhen when = Util.parseEnum <ETileWhen> (Util.getValue <string> (p_json, "when")); Effect effect = new Effect(Util.parseEnum <ETileResource> (p_json ["effect"] ["resource"].Value), p_json ["effect"] ["value"].AsInt); return(new Trigger(scope, when, tile_type, effect)); } catch (ArgumentException) { Debug.LogError("Error while trying to load trigger"); return(null); } }