Grouping of GamePieces
Custom classes
The GroupRotator and its associated classes are complementery custom
coded files which need to be included in your vassal module to be
functioning. You should have a source or a binary release to include
the files for usage. The custom classes can be found in the
com.fightingchaos.VASSAL classpath. The subpackag structure is the same
as the original VASSAL package structure. To incorporate custom classes
into your module please take a look at the VASSAL documentation.
The custom classes consist of the following in VASSAL usable classes:
- com.fightingchaos.VASSAL.build.module.EmpiresCommandEncoder
- com.fightingchaos.VASSAL.build.module.GroupingMap
- com.fightingchaos.VASSAL.counters.GroupCommand
- com.fightingchaos.VASSAL.counters.GroupRotator
- com.fightingchaos.VASSAL.counters.UngroupCommand
In
addition there are several classes, which are not directly used by the
developers/modder. They are just presented for completeness.
- com.fightingchaos.VASSAL.counters.Group
- com.fightingchaos.VASSAL.counters.GroupStackMetrics
The
custom classes were developped with VASSAL 3.1 in mind. (Actually last
build with VASSAL 3.1.0-beta5) If you encounter any problems with
previous versions of VASSAL (which you should) you should upgrade to a
newer VASSAL version. Any problems with the custom classes in newer
versions can be reported in the VASSAL forums.Developer classes
EmpiresCommandEncoder
A startup command encoder for VASSAL
which includes code for creation of GroupRotator GamePieces in your
module. The class is used in the VASSAL buildfile.
GroupingMap
A special kind of map which supports grouping and
ungrouping and uses groups instead of stacks for GamePiece collections.
Standard maps use stacks, which work in a different way than groups.
GroupCommand
The
GroupCommand is a VASSAL MassKeyCommand used on GroupingMaps to group a
selection of GamePieces into a Group. Use the standard selection
mechanics to chose your group members once finished click the
GroupCommand Button.
GroupRotator
GroupRotator is a property for GamePieces to be
able to free rotate all pieces of a group around a special pivot and
wheel point, or rotate all pieces of a group around the center of the
group by a fixed degree. For details on configuration of this custom
class have a look at the GroupRotator documentation.
GroupRotator
uses a Globalproperty with the name
Inch in Vassal to determin the
scale to be displayed besides the interactive rotation. If no scale is
present a preset value of 45 is used. It is multiplied with the
angle by 2*Math.PI/scale/360.0 to represent the length along the arc of
the rotation. Certain games use the rotation distance along the longest
arc as the movement indicator, the Inch property represent so one unit
of size on your game board, with the default of 45 pixels representing
one unit (whatever it may be).
UngroupCommand
The
UngroupCommand is a VASSAL MassKeyCommand used
on GroupingMaps to ungroup a selection of GamePieces into a Group.
Select a group by clicking on any member of the group and once
finished click the GroupCommand Button. You still have all pieces of
your group selected after ungrouping.
Hidden classes
Group
The group class is not directly used by Editors or
Developers of VASSAL modules. A Group is a special kind of VASAL Stack.
Groups preserve the location of each piece in the group. Pieces
anywhere on the map can be combined into groups and when ungrouped
again behave like an autonomous piece. While grouped the Group-Stack
behaves like a normal Stack. You can add standard pivot properties to
it, which will turn each piece around its own center, add other
Propeties as usual and use the custom GroupRotator to allow wheel /
turn operations on the whole group.
On a click on a group member
you select the whole group (all pieces of the group get highlighted),
on a double click, the group is opened an you can remove pieces of the
group. double click on a member of the group again closes the group.
(This is somewhat tricky and confusing and you are advised to use
group/ungroup commands for these operations)
GroupStackMetrics
The GroupStackMetrics is not directly used by
VASSAL modders. This class is directly associated with the GroupingMap.
It handles the custom drawing, creatin and presentation of GamePieces
which should be presented like a Group not like a Stack. At the moment
there is no possibility to specify the StackMetrics for a map
Usage examples
Examples how to use specific classes can be found in the example module.