From: <th...@us...> - 2009-03-29 23:58:07
|
Revision: 9796 http://pcgen.svn.sourceforge.net/pcgen/?rev=9796&view=rev Author: thpr Date: 2009-03-29 23:57:58 +0000 (Sun, 29 Mar 2009) Log Message: ----------- add getCurrentlySelected method to ChoiceActor This preparation work for the new CHOOSE system Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/cdom/base/ChoiceActor.java Trunk/pcgen/code/src/java/pcgen/cdom/helper/ClassSkillChoiceActor.java Trunk/pcgen/code/src/java/plugin/lsttokens/KitLst.java Trunk/pcgen/code/src/java/plugin/lsttokens/RegionLst.java Trunk/pcgen/code/src/java/plugin/lsttokens/ability/ModifyfeatchoiceToken.java Trunk/pcgen/code/src/java/plugin/lsttokens/add/AbilityToken.java Trunk/pcgen/code/src/java/plugin/lsttokens/add/EquipToken.java Trunk/pcgen/code/src/java/plugin/lsttokens/add/FeatToken.java Trunk/pcgen/code/src/java/plugin/lsttokens/add/LanguageToken.java Trunk/pcgen/code/src/java/plugin/lsttokens/add/SkillToken.java Trunk/pcgen/code/src/java/plugin/lsttokens/add/SpellCasterToken.java Trunk/pcgen/code/src/java/plugin/lsttokens/add/TemplateToken.java Trunk/pcgen/code/src/java/plugin/lsttokens/add/VFeatToken.java Trunk/pcgen/code/src/java/plugin/lsttokens/race/ChooseLangautoToken.java Trunk/pcgen/code/src/java/plugin/lsttokens/remove/FeatToken.java Trunk/pcgen/code/src/java/plugin/lsttokens/template/ChooseLangautoToken.java Trunk/pcgen/code/src/java/plugin/lsttokens/template/FeatToken.java Modified: Trunk/pcgen/code/src/java/pcgen/cdom/base/ChoiceActor.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/cdom/base/ChoiceActor.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/pcgen/cdom/base/ChoiceActor.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -17,6 +17,8 @@ */ package pcgen.cdom.base; +import java.util.List; + import pcgen.core.PlayerCharacter; /** @@ -62,4 +64,20 @@ * PlayerCharacter under the provided stacking conditions. */ public boolean allow(T choice, PlayerCharacter pc, boolean allowStack); + + /** + * Returns a list of the items *for this ChoiceActor* that have been + * previously selected. Note that this does not identify whether a PC + * has previously taken an item through another means (that is resolved + * by the allow method) This returns what has previously been selected + * and what should be placed in the 'selected' section of a chooser that + * is presented to the user. + * + * @param owner + * The owning object for this choice. + * @param pc + * The PlayerCharacter for which the currently selected items + * are being returned. + */ + public List<T> getCurrentlySelected(CDOMObject owner, PlayerCharacter pc); } Modified: Trunk/pcgen/code/src/java/pcgen/cdom/helper/ClassSkillChoiceActor.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/cdom/helper/ClassSkillChoiceActor.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/pcgen/cdom/helper/ClassSkillChoiceActor.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -17,6 +17,9 @@ */ package pcgen.cdom.helper; +import java.util.Collections; +import java.util.List; + import pcgen.cdom.base.CDOMObject; import pcgen.cdom.base.PersistentChoiceActor; import pcgen.cdom.enumeration.AssociationListKey; @@ -208,4 +211,23 @@ pc.removeAssoc(pcc, AssociationListKey.CSKILL, pcSkill); } + /** + * Returns a list of the items *for this ChoiceActor* that have been + * previously selected, which is an empty list, since this + * ClassSkillChoiceActor supports ADD: Note that this does not identify + * whether a PC has previously taken an item through another means (that is + * resolved by the allow method) This returns what has previously been + * selected and what should be placed in the 'selected' section of a chooser + * that is presented to the user. + * + * @param owner + * The owning object for this choice. + * @param pc + * The PlayerCharacter for which the currently selected items are + * being returned. + */ + public List<Skill> getCurrentlySelected(CDOMObject owner, PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/KitLst.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/KitLst.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/KitLst.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.Set; import java.util.StringTokenizer; @@ -171,4 +172,8 @@ return true; } + public List<Kit> getCurrentlySelected(CDOMObject owner, PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/RegionLst.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/RegionLst.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/RegionLst.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -5,6 +5,7 @@ package plugin.lsttokens; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -124,4 +125,10 @@ { return true; } + + public List<Region> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/ability/ModifyfeatchoiceToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/ability/ModifyfeatchoiceToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/ability/ModifyfeatchoiceToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -18,6 +18,7 @@ package plugin.lsttokens.ability; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -174,4 +175,10 @@ { return true; } + + public List<Ability> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/add/AbilityToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/add/AbilityToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/add/AbilityToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -450,4 +451,10 @@ .getSelection(), false, (AbilityCategory) choice .getAbilityCategory()); } + + public List<AbilitySelection> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/add/EquipToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/add/EquipToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/add/EquipToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -207,4 +208,10 @@ { pc.removeEquipment(choice); } + + public List<Equipment> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/add/FeatToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/add/FeatToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/add/FeatToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -364,4 +365,10 @@ AbilityUtilities.modFeat(pc, null, choice.getFullAbilityKey(), false, true); } + + public List<AbilitySelection> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/add/LanguageToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/add/LanguageToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/add/LanguageToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -221,4 +222,10 @@ { pc.removeLanguage(choice); } + + public List<Language> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/add/SkillToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/add/SkillToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/add/SkillToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -247,4 +248,9 @@ } } } + + public List<Skill> getCurrentlySelected(CDOMObject owner, PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/add/SpellCasterToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/add/SpellCasterToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/add/SpellCasterToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -259,4 +260,10 @@ theClass.setLevel(theClass.getLevel(pc), pc); } } + + public List<PCClass> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/add/TemplateToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/add/TemplateToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/add/TemplateToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -192,4 +193,10 @@ { pc.removeTemplate(choice); } + + public List<PCTemplate> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/add/VFeatToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/add/VFeatToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/add/VFeatToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -375,4 +376,10 @@ // featName, pc.getDirectVirtualAbilities(AbilityCategory.FEAT), // pc, null); } + + public List<AbilitySelection> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/race/ChooseLangautoToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/race/ChooseLangautoToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/race/ChooseLangautoToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -18,6 +18,7 @@ package plugin.lsttokens.race; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -202,4 +203,10 @@ { pc.removeFreeLanguage(choice); } + + public List<Language> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/remove/FeatToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/remove/FeatToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/remove/FeatToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -20,6 +20,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -336,4 +337,10 @@ AbilityUtilities.modFeat(pc, null, choice.getFullAbilityKey(), false, true); } + + public List<AbilitySelection> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/template/ChooseLangautoToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/template/ChooseLangautoToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/template/ChooseLangautoToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -18,6 +18,7 @@ package plugin.lsttokens.template; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -204,4 +205,10 @@ { pc.removeFreeLanguage(choice); } + + public List<Language> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/template/FeatToken.java =================================================================== --- Trunk/pcgen/code/src/java/plugin/lsttokens/template/FeatToken.java 2009-03-29 23:47:51 UTC (rev 9795) +++ Trunk/pcgen/code/src/java/plugin/lsttokens/template/FeatToken.java 2009-03-29 23:57:58 UTC (rev 9796) @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.StringTokenizer; @@ -279,4 +280,10 @@ } return true; } + + public List<AbilitySelection> getCurrentlySelected(CDOMObject owner, + PlayerCharacter pc) + { + return Collections.emptyList(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |