Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ahmad Reza Cheraghi
swarm-sim
Commits
8d8591f6
Commit
8d8591f6
authored
May 06, 2019
by
Ahmad Reza Cheraghi
Browse files
added more colors and deleted a duplicated get_matter_in method
parent
2a9d5357
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/particle.py
View file @
8d8591f6
...
...
@@ -17,6 +17,10 @@ gray = 2
red
=
3
green
=
4
blue
=
5
yellow
=
6
orange
=
7
cyan
=
8
violett
=
9
NE
=
0
...
...
@@ -311,30 +315,6 @@ class Particle(matter.Matter):
return
self
.
sim
.
get_coords_in_dir
(
self
.
coords
,
dir
)
in
self
.
sim
.
get_location_map_coords
()
def
get_matter_in_dir
(
self
,
matter
=
"tile"
,
dir
=
E
):
if
matter
==
"tile"
:
if
self
.
sim
.
get_coords_in_dir
(
self
.
coords
,
dir
)
in
self
.
sim
.
get_tile_map_coords
():
return
self
.
sim
.
get_tile_map_coords
()[
self
.
sim
.
get_coords_in_dir
(
self
.
coords
,
dir
)]
if
matter
==
"particle"
:
if
self
.
sim
.
get_coords_in_dir
(
self
.
coords
,
dir
)
in
self
.
sim
.
get_particle_map_coords
():
return
self
.
sim
.
get_particle_map_coords
()[
self
.
sim
.
get_coords_in_dir
(
self
.
coords
,
dir
)]
if
matter
==
"location"
:
if
self
.
sim
.
get_coords_in_dir
(
self
.
coords
,
dir
)
in
self
.
sim
.
get_location_map_coords
():
return
self
.
sim
.
get_location_map_coords
()[
self
.
sim
.
get_coords_in_dir
(
self
.
coords
,
dir
)]
def
scan_for_matter_within
(
self
,
matter
=
'all'
,
hop
=
1
):
"""
Scans for particles, tiles, or location on a given hop distance and all the matters within the hop distance
...
...
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