Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/core/rule/defaultruleset
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11841/src/games/stendhal/server/core/rule/defaultruleset
Modified Files:
DefaultCreature.java
Log Message:
Load creature sounds from xml and generate sound events for them
Index: DefaultCreature.java
===================================================================
RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/core/rule/defaultruleset/DefaultCreature.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** DefaultCreature.java 10 Jul 2012 20:38:22 -0000 1.13
--- DefaultCreature.java 19 Jan 2013 20:22:30 -0000 1.14
***************
*** 79,82 ****
--- 79,85 ----
private List<EquipItem> equipsItems;
+
+ /** List of possible sound events. */
+ private List<String> sounds;
private LinkedHashMap<String, LinkedList<String>> creatureSays;
***************
*** 234,238 ****
public Creature getCreature() {
Collections.sort(dropsItems, new Comparator<DropItem>() {
!
public int compare(final DropItem o1, final DropItem o2) {
if (o1.probability < o2.probability) {
--- 237,241 ----
public Creature getCreature() {
Collections.sort(dropsItems, new Comparator<DropItem>() {
! @Override
public int compare(final DropItem o1, final DropItem o2) {
if (o1.probability < o2.probability) {
***************
*** 244,248 ****
}
}
-
});
--- 247,250 ----
***************
*** 255,258 ****
--- 257,261 ----
creature.setSusceptibilities(susceptibilities);
creature.setDamageTypes(damageType, rangedDamageType);
+ creature.setSounds(sounds);
return creature;
***************
*** 292,295 ****
--- 295,307 ----
name = val;
}
+
+ /**
+ * Set the possible sound names.
+ *
+ * @param sounds list of sounds
+ */
+ public void setCreatureSounds(List<String> sounds) {
+ this.sounds = sounds;
+ }
public boolean verifyItems(final EntityManager defaultEntityManager) {
|