Starsector API
Loading...
Searching...
No Matches
RelationshipAPI.java
Go to the documentation of this file.
1package com.fs.starfarer.api.characters;
2
3import java.awt.Color;
4
5import com.fs.starfarer.api.Global;
6import com.fs.starfarer.api.campaign.FactionAPI;
7import com.fs.starfarer.api.campaign.RepLevel;
8
9public interface RelationshipAPI {
10
11 public static enum RelationshipTargetType {
12 FACTION,
13 PERSON,
14 PLAYER,
15 }
16
17 public static class RelationshipTarget {
18 private RelationshipTargetType type;
19 private PersonAPI person;
20 private FactionAPI faction;
21 public RelationshipTarget(RelationshipTargetType type) {
22 this.type = type;
23 }
24 public RelationshipTarget(RelationshipTargetType type, FactionAPI faction) {
25 this.type = type;
26 this.faction = faction;
27 }
28 public RelationshipTarget(RelationshipTargetType type, PersonAPI person) {
29 this.type = type;
30 this.person = person;
31 }
32 public RelationshipTargetType getType() {
33 return type;
34 }
35 public void setType(RelationshipTargetType type) {
36 this.type = type;
37 }
38 public PersonAPI getPerson() {
39 return person;
40 }
41 public void setPerson(PersonAPI person) {
42 this.person = person;
43 }
44 public FactionAPI getFaction() {
45 return faction;
46 }
47 public void setFaction(FactionAPI faction) {
48 this.faction = faction;
49 }
50 public boolean isPlayer() {
51 return type == RelationshipTargetType.PLAYER ||
52 (person != null && person == Global.getSector().getPlayerPerson());
53 }
54// public String getTargetId() {
55// if (faction != null) return faction.getId();
56// //if (person != null) return person.get
57// }
58 }
59
60
61 RelationshipTarget getTarget();
62 void setTarget(RelationshipTarget target);
63
64 float getRel();
65 void setRel(float rel);
66
67 RepLevel getLevel();
68 void setLevel(RepLevel level);
69
70 boolean isAtWorst(RepLevel level);
71 boolean isAtBest(RepLevel level);
72
73 boolean ensureAtBest(RepLevel level);
74 boolean ensureAtWorst(RepLevel level);
75
76 boolean adjustRelationship(float delta, RepLevel limit);
77
78 boolean isHostile();
79
80 Color getRelColor();
81 Color getRelColor(RepLevel level);
82 int getRepInt();
83
84}
static SectorAPI getSector()
Definition Global.java:59
boolean adjustRelationship(float delta, RepLevel limit)
void setTarget(RelationshipTarget target)