Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
2be636de
Commit
2be636de
authored
Oct 13, 2016
by
Jakob Schöttl
Browse files
Refactoring
parent
bb7d5bef
Changes
2
Hide whitespace changes
Inline
Side-by-side
VadereSimulator/src/org/vadere/simulator/models/seating/trainmodel/Compartment.java
View file @
2be636de
...
...
@@ -28,12 +28,7 @@ public class Compartment {
this
.
targetSeatMap
=
targetSeatMap
;
seatGroups
=
new
ArrayList
<>(
4
);
final
int
nSeatGroups
;
if
(
isHalfCompartment
())
{
nSeatGroups
=
2
;
}
else
{
nSeatGroups
=
4
;
}
final
int
nSeatGroups
=
isHalfCompartment
()
?
2
:
4
;
addCompartment
(
nSeatGroups
);
}
...
...
VadereSimulator/src/org/vadere/simulator/models/seating/trainmodel/SeatGroup.java
View file @
2be636de
...
...
@@ -38,7 +38,7 @@ public class SeatGroup {
final
int
compartmentIndex
=
compartment
.
getIndex
();
final
int
longRowIndex1
,
longRowIndex2
;
if
(
is
In
Left
Row
())
{
if
(
is
At
Left
Side
())
{
longRowIndex1
=
0
;
longRowIndex2
=
1
;
}
else
{
...
...
@@ -69,10 +69,6 @@ public class SeatGroup {
}
private
boolean
isInLeftRow
()
{
return
index
%
2
==
0
;
// even -> left row
}
public
Seat
getSeat
(
int
index
)
{
return
seats
.
get
(
index
);
}
...
...
@@ -173,7 +169,7 @@ public class SeatGroup {
public
Seat
availableSeatAtSide
(
SeatSide
side
)
{
int
[]
indexes
;
if
(
is
In
Left
Row
())
{
if
(
is
At
Left
Side
())
{
if
(
side
==
SeatSide
.
WINDOW
)
{
indexes
=
new
int
[]
{
0
,
2
};
}
else
{
...
...
@@ -224,4 +220,8 @@ public class SeatGroup {
return
getPersonCount
()
==
SEATS_PER_SEAT_GROUP
;
}
public
boolean
isAtLeftSide
()
{
return
index
%
2
==
0
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment