Skip to content

Commit

Permalink
Removed three more old deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
olekscode committed Aug 7, 2023
1 parent 77e4494 commit 707944a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 34 deletions.
31 changes: 0 additions & 31 deletions repository/Cormas-Core/CMSpatialEntityElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -813,14 +813,6 @@ CMSpatialEntityElement >> outlinePatch [
^self image component translatedBy: self center
]

{ #category : #deprecated }
CMSpatialEntityElement >> relativeDistanceTo: anotherCell constraint: aBlock [
"DEPRECATED. Should use: distanceTo: anotherCell constraintOnPath: aBlock
Return an integer : the distance (in cell unit) to anotherCell according to constraint (aBlock)."

^self shortestDistanceTo: anotherCell constraintOnPath: aBlock
]

{ #category : #accessing }
CMSpatialEntityElement >> rowNumber [
"Purpose: returns the Y coordinate of the cell in a regular spatial grid"
Expand All @@ -838,19 +830,6 @@ CMSpatialEntityElement >> segments [
^segments
]

{ #category : #deprecated }
CMSpatialEntityElement >> shortestDistanceTo: anotherCell constraintOnPath: aBlock [
"DEPRECATED. Should use: distanceTo: anotherCell constraintOnPath: aBlock
Purpose: gets the shortest distance (in cell unit) to anotherCell, taking a specified constraint into account.
Arguments: anotherCell = <SpatialEntityElement>
aBlock = <BlockClosure>
Return value: <Integer>
Example: self shortestDistanceTo: self spaceModel centralLocation constraintOnPath: [:aCell | aCell isClosed not]"

^(self wayTo: anotherCell constraint: aBlock) size - 1
]

{ #category : #'environment - distance' }
CMSpatialEntityElement >> shortestDistanceToCells: aCollecOfCells constraintOnPath: aBlock [
"Purpose: gets the shortest distance (Manhattan distance in cell unit) to a collection of other cells, taking a specified constraint into account.
Expand Down Expand Up @@ -914,16 +893,6 @@ Example: self wayTo: self spaceModel centralLocation"
^path
]

{ #category : #deprecated }
CMSpatialEntityElement >> wayTo: anotherCell constrainedBy: aCondition [
"DEPRECATED. Should use #wayTo: anotherCell constraint: aCondition
Return an OrderedCollection of cells describing the shortest way to anotherCell according to the constraint aBlock.
path := self wayTo: anotherCell constraint: [:aCell | aCell landCover ~= #ditch].
See example in 'DemoWayTo' model"

^self wayTo: anotherCell constraint: aCondition
]

{ #category : #'environment - sensing - space' }
CMSpatialEntityElement >> wayTo: anotherCell constraint: aBlock [
"Purpose: gets the shortest way satisfying a constraint to anotherCell
Expand Down
5 changes: 2 additions & 3 deletions repository/Cormas-Core/CMSpatialEntitySet.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -508,15 +508,14 @@ Example := self nearestCellVerifying: [:aCell | aCell hasWater] constraintOnPath
select: [:c | aBlock1 value: c].
collec ifNil: [^nil].
target := collec first.
minimum := self surround first shortestDistanceTo: target
constraintOnPath: aBlock2.
minimum := self surround first distanceTo: target constraintOnPath: aBlock2.
collec
do:
[:c |
self surround
do:
[:cs |
d := cs shortestDistanceTo: c constraintOnPath: aBlock2.
d := cs distanceTo: c constraintOnPath: aBlock2.
d = 0 ifTrue: [^c].
d < minimum
ifTrue:
Expand Down

0 comments on commit 707944a

Please sign in to comment.