!Room methodsFor: 'connecting'!

con_activeObject: anObject
	"Generated by MPOK 2.8 (fine)."

	"Connect to anObject, if possible"

	| spec |
	spec := self class specificationsForRelation: #activeObject.
	^spec isNil
		ifTrue: [activeObjectR isNil
			ifTrue: [activeObjectR := anObject]
			ifFalse: [self mooseConnectionError: 'A connection for this unspecified relation allready exists !!!!!!']]
		ifFalse: [(anObject behavesLike: (Smalltalk at: (spec at: #class)))
				ifTrue: [| this other |
					this := self activeObject: self activeObject.
					other := anObject perform: ((spec at: #return) asString,':') asSymbol with: (anObject perform: (spec at: #return)).
					((this connectTo: anObject) notNil
					and:[(other connectTo: self) notNil])
						ifFalse:[self mooseConnectionError: 'Connection failed !!!!!!']]
				ifFalse: [self mooseConnectionTypeError: anObject class name printString, 'expected']]!

con_fromWalls: anObject
	"Generated by MPOK 2.8 (fine)."

	"Connect to anObject, if possible"

	| spec |
	spec := self class specificationsForRelation: #fromWalls.
	^spec isNil
		ifTrue: [fromWallsR isNil
			ifTrue: [fromWallsR := anObject]
			ifFalse: [self mooseConnectionError: 'A connection for this unspecified relation allready exists !!!!!!']]
		ifFalse: [(anObject behavesLike: (Smalltalk at: (spec at: #class)))
				ifTrue: [| this other |
					this := self fromWalls: self fromWalls.
					other := anObject perform: ((spec at: #return) asString,':') asSymbol with: (anObject perform: (spec at: #return)).
					((this connectTo: anObject) notNil
					and:[(other connectTo: self) notNil])
						ifFalse:[self mooseConnectionError: 'Connection failed !!!!!!']]
				ifFalse: [self mooseConnectionTypeError: anObject class name printString, 'expected']]!

con_intoWalls: anObject
	"Generated by MPOK 2.8 (fine)."

	"Connect to anObject, if possible"

	| spec |
	spec := self class specificationsForRelation: #intoWalls.
	^spec isNil
		ifTrue: [intoWallsR isNil
			ifTrue: [intoWallsR := anObject]
			ifFalse: [self mooseConnectionError: 'A connection for this unspecified relation allready exists !!!!!!']]
		ifFalse: [(anObject behavesLike: (Smalltalk at: (spec at: #class)))
				ifTrue: [| this other |
					this := self intoWalls: self intoWalls.
					other := anObject perform: ((spec at: #return) asString,':') asSymbol with: (anObject perform: (spec at: #return)).
					((this connectTo: anObject) notNil
					and:[(other connectTo: self) notNil])
						ifFalse:[self mooseConnectionError: 'Connection failed !!!!!!']]
				ifFalse: [self mooseConnectionTypeError: anObject class name printString, 'expected']]!

con_RoomEvent: anObject
	"Generated by MPOK 2.8 (fine)."

	"Connect to anObject, if possible"

	| spec |
	spec := self class specificationsForRelation: #RoomEvent.
	^spec isNil
		ifTrue: [RoomEventR isNil
			ifTrue: [RoomEventR := anObject]
			ifFalse: [self mooseConnectionError: 'A connection for this unspecified relation allready exists !!!!!!']]
		ifFalse: [(anObject behavesLike: (Smalltalk at: (spec at: #class)))
				ifTrue: [| this other |
					this := self RoomEvent: self RoomEvent.
					other := anObject perform: ((spec at: #return) asString,':') asSymbol with: (anObject perform: (spec at: #return)).
					((this connectTo: anObject) notNil
					and:[(other connectTo: self) notNil])
						ifFalse:[self mooseConnectionError: 'Connection failed !!!!!!']]
				ifFalse: [self mooseConnectionTypeError: anObject class name printString, 'expected']]!

con_Surfaces: anObject
	"Generated by MPOK 2.8 (fine)."

	"Connect to anObject, if possible"

	| spec |
	spec := self class specificationsForRelation: #Surfaces.
	^spec isNil
		ifTrue: [SurfacesR isNil
			ifTrue: [SurfacesR := anObject]
			ifFalse: [self mooseConnectionError: 'A connection for this unspecified relation allready exists !!!!!!']]
		ifFalse: [(anObject behavesLike: (Smalltalk at: (spec at: #class)))
				ifTrue: [| this other |
					this := self Surfaces: self Surfaces.
					other := anObject perform: ((spec at: #return) asString,':') asSymbol with: (anObject perform: (spec at: #return)).
					((this connectTo: anObject) notNil
					and:[(other connectTo: self) notNil])
						ifFalse:[self mooseConnectionError: 'Connection failed !!!!!!']]
				ifFalse: [self mooseConnectionTypeError: anObject class name printString, 'expected']]!

dis_activeObject: anObject
	"Generated by MPOK 2.8 (fine)."

	"Disonnect from anObject, if possible"

	^activeObjectR isNil
		ifTrue: [self mooseConnectionError: 'No connections yet !!!!!!']
		ifFalse: [((self activeObject disconnectFrom: anObject)
				and:[(anObject perform: ((self class specificationsForRelation: #activeObject) at: #return))
						disconnectFrom: self])
					ifFalse:[self mooseConnectionError: 'Disconnect failed !!!!!!']]!

dis_fromWalls: anObject
	"Generated by MPOK 2.8 (fine)."

	"Disonnect from anObject, if possible"

	^fromWallsR isNil
		ifTrue: [self mooseConnectionError: 'No connections yet !!!!!!']
		ifFalse: [((self fromWalls disconnectFrom: anObject)
				and:[(anObject perform: ((self class specificationsForRelation: #fromWalls) at: #return))
						disconnectFrom: self])
					ifFalse:[self mooseConnectionError: 'Disconnect failed !!!!!!']]!

dis_intoWalls: anObject
	"Generated by MPOK 2.8 (fine)."

	"Disonnect from anObject, if possible"

	^intoWallsR isNil
		ifTrue: [self mooseConnectionError: 'No connections yet !!!!!!']
		ifFalse: [((self intoWalls disconnectFrom: anObject)
				and:[(anObject perform: ((self class specificationsForRelation: #intoWalls) at: #return))
						disconnectFrom: self])
					ifFalse:[self mooseConnectionError: 'Disconnect failed !!!!!!']]!

dis_RoomEvent: anObject
	"Generated by MPOK 2.8 (fine)."

	"Disonnect from anObject, if possible"

	^RoomEventR isNil
		ifTrue: [self mooseConnectionError: 'No connections yet !!!!!!']
		ifFalse: [((self RoomEvent disconnectFrom: anObject)
				and:[(anObject perform: ((self class specificationsForRelation: #RoomEvent) at: #return))
						disconnectFrom: self])
					ifFalse:[self mooseConnectionError: 'Disconnect failed !!!!!!']]!

dis_Surfaces: anObject
	"Generated by MPOK 2.8 (fine)."

	"Disonnect from anObject, if possible"

	^SurfacesR isNil
		ifTrue: [self mooseConnectionError: 'No connections yet !!!!!!']
		ifFalse: [((self Surfaces disconnectFrom: anObject)
				and:[(anObject perform: ((self class specificationsForRelation: #Surfaces) at: #return))
						disconnectFrom: self])
					ifFalse:[self mooseConnectionError: 'Disconnect failed !!!!!!']]! !

To increase readability of this file, some HTML tags have been included

(click here for the original file)