//
//  LKFIntAbtSAPSResult.swift
//  lkfc
//
//  Created by Alexander Holzer on 20.10.18.
//  Copyright © 2018 Alexander Holzer. All rights reserved.
//

import Foundation
@_implementationOnly import LibLKF

public class LKFIntAbtSAPSResult {
    
    public let scoreParts : [Int32]
    
    init (aufenthalt: LKFAufenthalt, index: UInt32, sapsIndex: UInt32) {
        
        var arr = [Int32]()
        for i in 0..<26 {
            arr.append (LibLKF.lkf_int_getAufSAPSScore(aufenthalt.ptr, index, sapsIndex, UInt32(i)))
        }
        
        scoreParts = arr
    }
    
    var score : Int32 {
        return scoreParts[0]
    }
    
    public var gcs: Int32 {
        return scoreParts[25]
    }
    
    public var partString : String {
        return "\(scoreParts[1])|\(scoreParts[2])|\(scoreParts[3])|\(scoreParts[4])|\(scoreParts[5])|\(scoreParts[6])|\(scoreParts[7])|\(scoreParts[8])|\(scoreParts[9])|\(scoreParts[10])|\(scoreParts[11])|\(scoreParts[12])|\(scoreParts[13])|\(scoreParts[14])|\(scoreParts[15])|\(scoreParts[16])|\(scoreParts[17])|\(scoreParts[18])|\(scoreParts[19])|\(scoreParts[20])|\(scoreParts[21])|\(scoreParts[22])|\(scoreParts[23])|\(scoreParts[24])"
    }
    
    init (context: LKFContext, index: UInt32, sapsIndex: UInt32) {

        var arr = [Int32]()
        for i in 0..<26 {
            arr.append(LibLKF.lkf_int_getIntAufenthaltSAPSScore(context.ptr!, index, sapsIndex, UInt32(i)))
        }
        
        scoreParts = arr
    }
}
