Commit 8d8591f6 authored by Ahmad Reza Cheraghi's avatar Ahmad Reza Cheraghi
Browse files

added more colors and deleted a duplicated get_matter_in method

parent 2a9d5357
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment