Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Exalted Sheet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pr1n19
Exalted Sheet
Commits
7b1062c3
Commit
7b1062c3
authored
3 years ago
by
pr1n19
Browse files
Options
Downloads
Patches
Plain Diff
Updated Abilities to use hashmap<String, Integer>
parent
1b95956d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
javaFxTest.iml
+4
-4
4 additions, 4 deletions
javaFxTest.iml
src/main/java/Character/Abilities.java
+21
-24
21 additions, 24 deletions
src/main/java/Character/Abilities.java
src/main/java/UI/AbilitiesList.java
+40
-0
40 additions, 0 deletions
src/main/java/UI/AbilitiesList.java
with
65 additions
and
28 deletions
javaFxTest.iml
+
4
−
4
View file @
7b1062c3
...
@@ -8,13 +8,13 @@
...
@@ -8,13 +8,13 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/resources"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/resources"
type=
"java-resource"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/target"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/target"
/>
</content>
</content>
<orderEntry
type=
"
jdk"
jdkName=
"openjdk-16"
jdkType=
"JavaSDK
"
/>
<orderEntry
type=
"
inheritedJdk
"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"library"
name=
"Maven: org.openjfx:javafx-controls:15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.openjfx:javafx-controls:15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.openjfx:javafx-controls:
w
in:15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.openjfx:javafx-controls:
l
in
ux
:15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.openjfx:javafx-graphics:15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.openjfx:javafx-graphics:15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.openjfx:javafx-graphics:
w
in:15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.openjfx:javafx-graphics:
l
in
ux
:15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.openjfx:javafx-base:15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.openjfx:javafx-base:15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.openjfx:javafx-base:
w
in:15.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.openjfx:javafx-base:
l
in
ux
:15.0.1"
level=
"project"
/>
</component>
</component>
</module>
</module>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/java/Character/Abilities.java
+
21
−
24
View file @
7b1062c3
package
Character
;
package
Character
;
import
java.util.HashMap
;
public
class
Abilities
{
public
class
Abilities
{
//Lists of names of abilities
//Lists of names of abilities
private
final
String
[]
warAbilityNames
=
new
String
[]{
"Archery"
,
"Athletics"
,
"Awareness"
,
"Dodge"
,
"Integrity"
,
"Martial Arts"
,
"Melee"
,
"Resistance"
,
"Thrown"
,
"War"
};
private
final
String
[]
warAbilityNames
=
new
String
[]{
"Archery"
,
"Athletics"
,
"Awareness"
,
"Dodge"
,
"Integrity"
,
"Martial Arts"
,
"Melee"
,
"Resistance"
,
"Thrown"
,
"War"
};
...
@@ -7,18 +9,25 @@ public class Abilities {
...
@@ -7,18 +9,25 @@ public class Abilities {
private
final
String
[]
wisdomAbilityNames
=
new
String
[]{
"Bureaucracy"
,
"Investigation"
,
"Lore"
,
"Occult"
,
"Medicine"
};
private
final
String
[]
wisdomAbilityNames
=
new
String
[]{
"Bureaucracy"
,
"Investigation"
,
"Lore"
,
"Occult"
,
"Medicine"
};
//Lists of values of abilities
//Lists of values of abilities
private
final
int
[]
warAbilities
;
private
final
HashMap
<
String
,
Integer
>
allAbilities
=
new
HashMap
<>();
private
final
int
[]
lifeAbilities
;
private
final
int
[]
wisdomAbilities
;
/**
/**
* Manage abilities as on the character sheet
* Manage abilities as on the character sheet
*/
*/
public
Abilities
(
int
[]
war
,
int
[]
life
,
int
[]
wisdom
)
{
public
Abilities
(
int
[]
war
,
int
[]
life
,
int
[]
wisdom
)
{
//Set abilities
//Create all abilities list
warAbilities
=
war
;
int
i0
=
0
;
lifeAbilities
=
life
;
for
(
String
ability:
warAbilityNames
)
{
wisdomAbilities
=
wisdom
;
allAbilities
.
put
(
ability
,
war
[
i0
++]);
}
int
i1
=
0
;
for
(
String
ability:
lifeAbilityNames
)
{
allAbilities
.
put
(
ability
,
life
[
i1
++]);
}
int
i2
=
0
;
for
(
String
ability:
wisdomAbilityNames
)
{
allAbilities
.
put
(
ability
,
wisdom
[
i2
++]);
}
}
}
/**
/**
...
@@ -35,28 +44,16 @@ public class Abilities {
...
@@ -35,28 +44,16 @@ public class Abilities {
}
}
/**
/**
* Return
ability
of given
number
* Return
value
of given
ability
*/
*/
public
int
getWarAbility
(
int
selector
)
{
public
int
getAbility
(
String
ability
)
{
return
warAbilities
[
selector
];
return
allAbilities
.
get
(
ability
);
}
public
int
getLifeAbility
(
int
selector
)
{
return
lifeAbilities
[
selector
];
}
public
int
getWisdomAbility
(
int
selector
)
{
return
wisdomAbilities
[
selector
];
}
}
/**
/**
* Set value of given numbered ability
* Set value of given numbered ability
*/
*/
public
void
setWarAbility
(
int
selector
,
int
value
)
{
public
void
setAbility
(
String
selector
,
int
value
)
{
warAbilities
[
selector
]
=
value
;
allAbilities
.
put
(
selector
,
value
);
}
public
void
setLifeAbility
(
int
selector
,
int
value
)
{
lifeAbilities
[
selector
]
=
value
;
}
public
void
setWisdomAbility
(
int
selector
,
int
value
)
{
wisdomAbilities
[
selector
]
=
value
;
}
}
}
}
This diff is collapsed.
Click to expand it.
src/main/java/UI/AbilitiesList.java
+
40
−
0
View file @
7b1062c3
...
@@ -2,23 +2,37 @@ package UI;
...
@@ -2,23 +2,37 @@ package UI;
import
javafx.scene.control.ScrollPane
;
import
javafx.scene.control.ScrollPane
;
import
javafx.scene.layout.HBox
;
import
javafx.scene.layout.HBox
;
import
javafx.scene.layout.Pane
;
import
javafx.scene.layout.StackPane
;
import
javafx.scene.layout.StackPane
;
import
javafx.scene.text.Text
;
import
javafx.scene.text.Text
;
import
Character.Abilities
;
import
Character.CharacterInterface
;
public
class
AbilitiesList
extends
ScrollPane
{
public
class
AbilitiesList
extends
ScrollPane
{
private
final
Sheet
sheet
;
private
final
Sheet
sheet
;
private
final
Abilities
abilities
;
private
final
HBox
container
;
private
final
HBox
container
;
public
AbilitiesList
(
Sheet
sheet
)
{
public
AbilitiesList
(
Sheet
sheet
)
{
//Set sheet
//Set sheet
this
.
sheet
=
sheet
;
this
.
sheet
=
sheet
;
abilities
=
CharacterInterface
.
getAbilities
();
//Set HBox into scroll pane to hold Names & values
//Set HBox into scroll pane to hold Names & values
container
=
new
HBox
();
container
=
new
HBox
();
this
.
getChildren
().
add
(
container
);
this
.
getChildren
().
add
(
container
);
//Set War title & ability listings
addTitle
(
"War"
);
int
start
=
createAbilityListings
(
abilities
.
getWarNames
(),
0
);
//Set Life title & ability listings
addTitle
(
"Life"
);
start
=
createAbilityListings
(
abilities
.
getLifeNames
(),
start
);
//Set Wisdom title & ability listings
addTitle
(
"Wisdom"
);
createAbilityListings
(
abilities
.
getWisdomNames
(),
start
);
}
}
/**
/**
...
@@ -31,4 +45,30 @@ public class AbilitiesList extends ScrollPane {
...
@@ -31,4 +45,30 @@ public class AbilitiesList extends ScrollPane {
pane
.
getChildren
().
add
(
text
);
pane
.
getChildren
().
add
(
text
);
}
}
/**
* Loop through given list and create pane for each
*/
private
int
createAbilityListings
(
String
[]
list
,
int
startAt
)
{
int
i
=
startAt
;
for
(
String
ability:
list
)
{
StackPane
pane
=
new
StackPane
();
}
return
i
;
}
/**
* Take pane & show listing
*/
private
void
showAbility
(
StackPane
pane
,
int
selector
)
{
}
/**
* Takes pane & shows input screen
*/
private
void
takeInput
()
{
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment