33 lines
594 B
Swift
33 lines
594 B
Swift
//
|
|
// PlayerMovesService.swift
|
|
// GoldWars
|
|
//
|
|
// Created by Tim Herbst on 13.05.20.
|
|
// Copyright © 2020 SP2. All rights reserved.
|
|
//
|
|
|
|
struct PlayerMove : Codable{
|
|
let fromBase: Int
|
|
let toBase: Int
|
|
let unitCount: Int
|
|
}
|
|
|
|
struct Host: Codable {
|
|
let playerName: String
|
|
}
|
|
|
|
class DataService {
|
|
static let sharedInstance = DataService()
|
|
var playerMoves: [PlayerMove] = []
|
|
var gameHost: Host?
|
|
|
|
|
|
func addMove(playerMove: PlayerMove) {
|
|
self.playerMoves.append(playerMove)
|
|
}
|
|
|
|
func setGameHost(host: Host) {
|
|
self.gameHost = host
|
|
}
|
|
}
|