Files
moonlight-ios/Limelight/Input/Controller.swift
David 983c65d399 Rewrote the Controller class in Swift (#216)
* Enabled Defines Modules for swift code

* Created bridge header, created swift Controller

-  Created Controller.swift
-  Created bridge header for use of objc in swift

* Finished porting Controller files to swift

* Added comments, created MoonlightUnitTest

-  Added comments for Controller.swift
-  Created MoonlightUnitTest for testing new class

* Started writing tests for ControllerUnitTests

-  General formatting
-  Wrote helper functions
-  Wrote tests for first four properties

* Finished writing Controller tests

* Removed commented out lines
2016-04-11 20:44:02 -07:00

27 lines
887 B
Swift

//
// Controller.swift
// Moonlight
//
// Created by David Aghassi on 4/11/16.
// Copyright © 2016 Moonlight Stream. All rights reserved.
//
import Foundation
@objc
/**
Defines a controller layout
*/
class Controller: NSObject {
// Swift requires initial properties
var playerIndex: CInt = 0 // Controller number (e.g. 1, 2 ,3 etc)
var lastButtonFlags: CInt = 0
var emulatingButtonFlags: CInt = 0
var lastLeftTrigger: CChar = 0 // Last left trigger pressed
var lastRightTrigger: CChar = 0 // Last right trigger pressed
var lastLeftStickX: CShort = 0 // Last X direction the left joystick went
var lastLeftStickY: CShort = 0 // Last Y direction the left joystick went
var lastRightStickX: CShort = 0 // Last X direction the right joystick went
var lastRightStickY: CShort = 0 // Last Y direction the right joystick went
}