Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created September 18, 2018 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/0625941fab1c1a1cd9cbaa9fc4208367 to your computer and use it in GitHub Desktop.
Save fitomad/0625941fab1c1a1cd9cbaa9fc4208367 to your computer and use it in GitHub Desktop.
public protocol Moveable
{
associatedtype Element
// Nombre del elemento
var name: String { get }
/**
Informa de la intención de otro elemento moverse a una
nueva posición.
Cada elemento debe comprobar si está ocupando la posición
que el otro elemento quiere ocupar.
- Parameters:
- element: El elemento que quiere moverse
- position: La nueva posición que quiere ocupar
- Returns: Si puede moverse a la nueva posición o no
*/
func element(_ element: Element, willMoveToPosition position: Position) -> Bool
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment