Starsector API
Loading...
Searching...
No Matches
UnhidePerson.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.rulecmd;
2
3import java.util.List;
4import java.util.Map;
5
6import com.fs.starfarer.api.Global;
7import com.fs.starfarer.api.campaign.InteractionDialogAPI;
8import com.fs.starfarer.api.campaign.rules.MemoryAPI;
9import com.fs.starfarer.api.characters.PersonAPI;
10import com.fs.starfarer.api.util.Misc.Token;
11
15public class UnhidePerson extends BaseCommandPlugin {
16
17 public boolean execute(String ruleId, InteractionDialogAPI dialog, List<Token> params, Map<String, MemoryAPI> memoryMap) {
18
19 // if you wanted to just pass in the person ID. The person has to have been
20 // added to ImportantPeople at some point (as the people defined in People are)
21 String id = params.get(0).getString(memoryMap);
22 PersonAPI person = Global.getSector().getImportantPeople().getPerson(id);
23
24 //VarAndMemory var = params.get(0).getVarNameAndMemory(memoryMap);
25 //PersonAPI person = (PersonAPI) var.memory.get(var.name);
26
27 if (person.getMarket() == null) return false;
28 if (person.getMarket().getCommDirectory() == null) return false;
29 if (person.getMarket().getCommDirectory().getEntryForPerson(person.getId()) == null) return false;
30
31 person.getMarket().getCommDirectory().getEntryForPerson(person.getId()).setHidden(false);
32 return true;
33 }
34}
static SectorAPI getSector()
Definition Global.java:59
boolean execute(String ruleId, InteractionDialogAPI dialog, List< Token > params, Map< String, MemoryAPI > memoryMap)