software-projekt-2-gold-wars/GoldWars/GoldWars/PlayerMovesService.swift
2020-05-13 20:22:23 +02:00

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
}
}