You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
807 B
30 lines
807 B
//
|
|
// File.swift
|
|
//
|
|
//
|
|
// Created by Louis DUFOUR on 22/01/2024.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Move {
|
|
public let owner: Owner
|
|
public let rowOrigin: Int
|
|
public let columnOrigin: Int
|
|
public let rowDestination: Int
|
|
public let columnDestination: Int
|
|
|
|
public init(owner: Owner, rowOrigin: Int, columnOrigin: Int, rowDestination: Int, columnDestination: Int) {
|
|
self.owner = owner
|
|
self.rowOrigin = rowOrigin
|
|
self.columnOrigin = columnOrigin
|
|
self.rowDestination = rowDestination
|
|
self.columnDestination = columnDestination
|
|
}
|
|
|
|
public var description: String {
|
|
let description = "Move by \(owner): (\(rowOrigin) / \(columnOrigin)) to (\(rowDestination) / \(columnDestination))"
|
|
return description
|
|
}
|
|
}
|