Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
V
vadere
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
110
Issues
110
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
3
Merge Requests
3
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vadere
vadere
Commits
0ecc2ddd
Commit
0ecc2ddd
authored
Dec 13, 2016
by
Jakob Schöttl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify and fix code for cloning
parent
de80d934
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
VadereState/src/org/vadere/state/scenario/Topography.java
VadereState/src/org/vadere/state/scenario/Topography.java
+16
-12
No files found.
VadereState/src/org/vadere/state/scenario/Topography.java
View file @
0ecc2ddd
...
...
@@ -338,41 +338,45 @@ public class Topography {
/**
* Creates a deep copy of the scenario.
*
* @deprecated This manual implementation is error-prone. Remove this method
* and use the standard clone instead.
*/
@Deprecated
@Override
public
Topography
clone
()
{
Topography
s
=
new
Topography
(
this
.
attributes
,
this
.
attributesPedestrian
,
this
.
attributesCar
);
for
(
Obstacle
obstacle
:
this
.
getObstacles
())
{
if
(
this
.
boundaryObstacles
.
contains
(
obstacle
))
s
.
addBoundary
(
obstacle
.
clone
());
if
(
boundaryObstacles
.
contains
(
obstacle
))
s
.
addBoundary
(
(
Obstacle
)
obstacle
.
clone
());
else
s
.
addObstacle
(
obstacle
.
clone
());
s
.
addObstacle
(
(
Obstacle
)
obstacle
.
clone
());
}
for
(
Stairs
stairs
:
this
.
getStairs
())
{
for
(
Stairs
stairs
:
getStairs
())
{
s
.
addStairs
(
stairs
);
}
for
(
Target
target
:
this
.
getTargets
())
{
s
.
addTarget
(
target
.
clone
());
for
(
Target
target
:
getTargets
())
{
s
.
addTarget
(
(
Target
)
target
.
clone
());
}
for
(
Source
source
:
this
.
getSources
())
{
s
.
addSource
(
source
.
clone
());
for
(
Source
source
:
getSources
())
{
s
.
addSource
(
(
Source
)
source
.
clone
());
}
for
(
Pedestrian
pedestrian
:
this
.
getElements
(
Pedestrian
.
class
))
{
for
(
Pedestrian
pedestrian
:
getElements
(
Pedestrian
.
class
))
{
s
.
addElement
(
pedestrian
);
}
for
(
Pedestrian
ped
:
getInitialElements
(
Pedestrian
.
class
))
{
s
.
addInitialElement
(
ped
);
}
for
(
Car
car
:
this
.
getElements
(
Car
.
class
))
{
for
(
Car
car
:
getElements
(
Car
.
class
))
{
s
.
addElement
(
car
);
}
for
(
Car
car
:
getInitialElements
(
Car
.
class
))
{
s
.
addInitialElement
(
car
);
}
if
(
this
.
hasTeleporter
())
{
s
.
setTeleporter
(
this
.
getTeleporter
()
.
clone
());
if
(
hasTeleporter
())
{
s
.
setTeleporter
(
(
Teleporter
)
teleporter
.
clone
());
}
for
(
DynamicElementAddListener
<
Pedestrian
>
pedestrianAddListener
:
this
.
pedestrians
.
getElementAddedListener
())
{
...
...
Write
Preview
Markdown
is supported
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