Reflective Mirrors (#11677)

This commit is contained in:
Geeves
2021-06-02 22:19:18 -03:00
committed by GitHub
parent d81d45ad1f
commit 4d96539d8a
6 changed files with 162 additions and 2 deletions
+24
View File
@@ -0,0 +1,24 @@
// Observer Pattern Implementation: Entered
// Registration type: /atom
//
// Raised when: An /atom/movable instance has entered an atom.
//
// Arguments that the called proc should expect:
// /atom/entered: The atom that was entered
// /atom/movable/enterer: The instance that entered the atom
// /atom/old_loc: The atom the enterer came from
//
var/datum/observ/entered/entered_event = new()
/datum/observ/entered
name = "Entered"
expected_type = /atom
/*******************
* Entered Handling *
*******************/
/atom/Entered(atom/movable/enterer, atom/old_loc)
..()
entered_event.raise_event(src, enterer, old_loc)
+24
View File
@@ -0,0 +1,24 @@
// Observer Pattern Implementation: Exited
// Registration type: /atom
//
// Raised when: An /atom/movable instance has exited an atom.
//
// Arguments that the called proc should expect:
// /atom/entered: The atom that was exited from
// /atom/movable/exitee: The instance that exited the atom
// /atom/new_loc: The atom the exitee is now residing in
//
var/datum/observ/exited/exited_event = new()
/datum/observ/exited
name = "Exited"
expected_type = /atom
/******************
* Exited Handling *
******************/
/atom/Exited(atom/movable/exitee, atom/new_loc)
. = ..()
exited_event.raise_event(src, exitee, new_loc)