Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
memfrag committed Mar 10, 2024
0 parents commit 11112c3
Show file tree
Hide file tree
Showing 14 changed files with 804 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
################################
### Xcode project .gitignore ###
################################

### macOS ###

.DS_Store

### User settings and such ###

xcuserdata/

### Build Artifacts ###

*.hmap
*.ipa
*.dSYM.zip
*.dSYM

xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.xccheckout
build/

### Swift Package Manager ###

.build/

### Playgrounds ###

timeline.xctimeline
playground.xcworkspace
105 changes: 105 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
whitelist_rules: # only these rules will be applied
- colon
- comma
- conditional_returns_on_newline
- control_statement
- empty_enum_arguments
- empty_parameters
- empty_parentheses_with_trailing_closure
- file_length
- legacy_cggeometry_functions
- legacy_constant
- legacy_constructor
- legacy_hashing
- legacy_nsgeometry_functions
- line_length
- class_delegate_protocol
- weak_delegate
- closing_brace
- closure_end_indentation
- closure_parameter_position
- closure_spacing
- explicit_init
- generic_type_name
- identical_operands
- implicit_getter
- is_disjoint
- leading_whitespace
- literal_expression_end_indentation
- mark
- modifier_order
- multiline_arguments
- multiline_function_chains
- multiple_closures_with_trailing_closure
- operator_usage_whitespace
- operator_whitespace
- overridden_super_call
- override_in_extension
- prohibited_super_call
- protocol_property_accessors_order
- redundant_discardable_let
- redundant_nil_coalescing
- redundant_objc_attribute
- redundant_optional_initialization
- redundant_void_return
- return_arrow_whitespace
- shorthand_operator
- statement_position
- switch_case_alignment
- syntactic_sugar
- trailing_comma
- trailing_semicolon
- type_name
- unneeded_break_in_switch
- unused_enumerated
- unused_optional_binding
- valid_ibinspectable
- vertical_parameter_alignment
- vertical_parameter_alignment_on_call
- vertical_whitespace
- void_return
- yoda_condition
- array_init
- attributes
- compiler_protocol_init
- contains_over_first_not_nil
- discouraged_direct_init
- discouraged_object_literal
- discouraged_optional_boolean
- dynamic_inline
- force_try
- force_unwrapping
- legacy_random

# The values below are not final and may need further tweaking.

file_length:
- 2000 #warning
- 2500 #error

function_body_length:
- 200 #warning
- 400 #error

line_length:
- 200 #warning
- 400 #error

type_body_length:
- 1000 #warning
- 2000 #error

identifier_name:
min_length: 1 #warning
max_length: #warning or error
warning: 100
error: 150

type_name:
min_length: 1
max_length: 80 #warning

excluded: # paths to ignore during linting. Takes precedence over `included`.
- External

reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji, sonarqube, markdown)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FILEHEADER</key>
<string>
// Copyright © ___YEAR___ Apparata AB. All rights reserved.
//</string>
</dict>
</plist>
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
BSD Zero Clause License

Copyright (c) 2024 by Apparata AB

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
24 changes: 24 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// swift-tools-version:5.10

import PackageDescription

let package = Package(
name: "GameInput",
platforms: [
// Relevant platforms.
.iOS(.v15), .macOS(.v12), .tvOS(.v15), .visionOS(.v1)
],
products: [
.library(name: "GameInput", targets: ["GameInput"])
],
targets: [
.target(
name: "GameInput",
dependencies: [],
swiftSettings: [
.define("DEBUG", .when(configuration: .debug)),
.define("RELEASE", .when(configuration: .release)),
.define("SWIFT_PACKAGE")
]),
]
)
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# GameInput

Simple game input for iOS, macOS, tvOS, and visionOS.

## License

See the LICENSE file for licensing information.
9 changes: 9 additions & 0 deletions Sources/GameInput/Game Pad/AnalogGamePadButton.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Foundation

public enum AnalogGamePadButton {

// MARK: Trigger Buttons

case leftTrigger // 􀨘 or 􀨌
case rightTrigger // 􀨚 or 􀨒
}
Loading

0 comments on commit 11112c3

Please sign in to comment.