Initial Commit
This commit is contained in:
commit
a00d0ca111
348
Munchkin.xcodeproj/project.pbxproj
Normal file
348
Munchkin.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,348 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 48;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
F60F50F52041EB7C001D861C /* Ability.swift in Sources */ = {isa = PBXBuildFile; fileRef = F60F50F42041EB7C001D861C /* Ability.swift */; };
|
||||||
|
F668975F204217D900D60FE4 /* WeaponKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = F668975E204217D900D60FE4 /* WeaponKind.swift */; };
|
||||||
|
F69E99782040D40900053141 /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = F69E99772040D40900053141 /* Card.swift */; };
|
||||||
|
F69E997A2040D4AD00053141 /* CardType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F69E99792040D4AD00053141 /* CardType.swift */; };
|
||||||
|
F69E997C2040D53300053141 /* Side.swift in Sources */ = {isa = PBXBuildFile; fileRef = F69E997B2040D53300053141 /* Side.swift */; };
|
||||||
|
F69E997E2040D81000053141 /* Global.swift in Sources */ = {isa = PBXBuildFile; fileRef = F69E997D2040D81000053141 /* Global.swift */; };
|
||||||
|
F6E73F7D2040E3FC005C6A28 /* CardSelectController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6E73F7C2040E3FC005C6A28 /* CardSelectController.swift */; };
|
||||||
|
F6EEFA112041C9F4006EA9A6 /* AffectsSelectController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6EEFA102041C9F4006EA9A6 /* AffectsSelectController.swift */; };
|
||||||
|
F6F931AC203F067100B50CAC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6F931AB203F067100B50CAC /* AppDelegate.swift */; };
|
||||||
|
F6F931AE203F067100B50CAC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6F931AD203F067100B50CAC /* ViewController.swift */; };
|
||||||
|
F6F931B0203F067100B50CAC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F6F931AF203F067100B50CAC /* Assets.xcassets */; };
|
||||||
|
F6F931B3203F067100B50CAC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F6F931B1203F067100B50CAC /* Main.storyboard */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
F60F50F42041EB7C001D861C /* Ability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ability.swift; sourceTree = "<group>"; };
|
||||||
|
F668975E204217D900D60FE4 /* WeaponKind.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeaponKind.swift; sourceTree = "<group>"; };
|
||||||
|
F69E99772040D40900053141 /* Card.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Card.swift; sourceTree = "<group>"; };
|
||||||
|
F69E99792040D4AD00053141 /* CardType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardType.swift; sourceTree = "<group>"; };
|
||||||
|
F69E997B2040D53300053141 /* Side.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Side.swift; sourceTree = "<group>"; };
|
||||||
|
F69E997D2040D81000053141 /* Global.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Global.swift; sourceTree = "<group>"; };
|
||||||
|
F6E73F7C2040E3FC005C6A28 /* CardSelectController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardSelectController.swift; sourceTree = "<group>"; };
|
||||||
|
F6EEFA102041C9F4006EA9A6 /* AffectsSelectController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AffectsSelectController.swift; sourceTree = "<group>"; };
|
||||||
|
F6F931A8203F067100B50CAC /* Munchkin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Munchkin.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
F6F931AB203F067100B50CAC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
|
F6F931AD203F067100B50CAC /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||||
|
F6F931AF203F067100B50CAC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
|
F6F931B2203F067100B50CAC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||||
|
F6F931B4203F067100B50CAC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
F6F931B5203F067100B50CAC /* Munchkin.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Munchkin.entitlements; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
F6F931A5203F067100B50CAC /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
F6F9319F203F067100B50CAC = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F6F931AA203F067100B50CAC /* Munchkin */,
|
||||||
|
F6F931A9203F067100B50CAC /* Products */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F6F931A9203F067100B50CAC /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F6F931A8203F067100B50CAC /* Munchkin.app */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F6F931AA203F067100B50CAC /* Munchkin */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F6F931AB203F067100B50CAC /* AppDelegate.swift */,
|
||||||
|
F6F931AD203F067100B50CAC /* ViewController.swift */,
|
||||||
|
F6E73F7C2040E3FC005C6A28 /* CardSelectController.swift */,
|
||||||
|
F6EEFA102041C9F4006EA9A6 /* AffectsSelectController.swift */,
|
||||||
|
F6F931AF203F067100B50CAC /* Assets.xcassets */,
|
||||||
|
F6F931B1203F067100B50CAC /* Main.storyboard */,
|
||||||
|
F6F931B4203F067100B50CAC /* Info.plist */,
|
||||||
|
F6F931B5203F067100B50CAC /* Munchkin.entitlements */,
|
||||||
|
F69E99772040D40900053141 /* Card.swift */,
|
||||||
|
F69E997D2040D81000053141 /* Global.swift */,
|
||||||
|
F69E997B2040D53300053141 /* Side.swift */,
|
||||||
|
F69E99792040D4AD00053141 /* CardType.swift */,
|
||||||
|
F60F50F42041EB7C001D861C /* Ability.swift */,
|
||||||
|
F668975E204217D900D60FE4 /* WeaponKind.swift */,
|
||||||
|
);
|
||||||
|
path = Munchkin;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
F6F931A7203F067100B50CAC /* Munchkin */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = F6F931B8203F067100B50CAC /* Build configuration list for PBXNativeTarget "Munchkin" */;
|
||||||
|
buildPhases = (
|
||||||
|
F6F931A4203F067100B50CAC /* Sources */,
|
||||||
|
F6F931A5203F067100B50CAC /* Frameworks */,
|
||||||
|
F6F931A6203F067100B50CAC /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = Munchkin;
|
||||||
|
productName = Munchkin;
|
||||||
|
productReference = F6F931A8203F067100B50CAC /* Munchkin.app */;
|
||||||
|
productType = "com.apple.product-type.application";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
F6F931A0203F067100B50CAC /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
LastSwiftUpdateCheck = 0920;
|
||||||
|
LastUpgradeCheck = 0920;
|
||||||
|
ORGANIZATIONNAME = "Peter Terpstra";
|
||||||
|
TargetAttributes = {
|
||||||
|
F6F931A7203F067100B50CAC = {
|
||||||
|
CreatedOnToolsVersion = 9.2;
|
||||||
|
ProvisioningStyle = Automatic;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = F6F931A3203F067100B50CAC /* Build configuration list for PBXProject "Munchkin" */;
|
||||||
|
compatibilityVersion = "Xcode 8.0";
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = F6F9319F203F067100B50CAC;
|
||||||
|
productRefGroup = F6F931A9203F067100B50CAC /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
F6F931A7203F067100B50CAC /* Munchkin */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
F6F931A6203F067100B50CAC /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
F6F931B0203F067100B50CAC /* Assets.xcassets in Resources */,
|
||||||
|
F6F931B3203F067100B50CAC /* Main.storyboard in Resources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
F6F931A4203F067100B50CAC /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
F6EEFA112041C9F4006EA9A6 /* AffectsSelectController.swift in Sources */,
|
||||||
|
F60F50F52041EB7C001D861C /* Ability.swift in Sources */,
|
||||||
|
F6F931AE203F067100B50CAC /* ViewController.swift in Sources */,
|
||||||
|
F69E997A2040D4AD00053141 /* CardType.swift in Sources */,
|
||||||
|
F69E997C2040D53300053141 /* Side.swift in Sources */,
|
||||||
|
F668975F204217D900D60FE4 /* WeaponKind.swift in Sources */,
|
||||||
|
F69E997E2040D81000053141 /* Global.swift in Sources */,
|
||||||
|
F6E73F7D2040E3FC005C6A28 /* CardSelectController.swift in Sources */,
|
||||||
|
F69E99782040D40900053141 /* Card.swift in Sources */,
|
||||||
|
F6F931AC203F067100B50CAC /* AppDelegate.swift in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXVariantGroup section */
|
||||||
|
F6F931B1203F067100B50CAC /* Main.storyboard */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
F6F931B2203F067100B50CAC /* Base */,
|
||||||
|
);
|
||||||
|
name = Main.storyboard;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXVariantGroup section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
F6F931B6203F067100B50CAC /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "-";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
F6F931B7203F067100B50CAC /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "-";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
F6F931B9203F067100B50CAC /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = Munchkin/Munchkin.entitlements;
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
INFOPLIST_FILE = Munchkin/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = peterterpstra.Munchkin;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 4.0;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
F6F931BA203F067100B50CAC /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = Munchkin/Munchkin.entitlements;
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
INFOPLIST_FILE = Munchkin/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = peterterpstra.Munchkin;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 4.0;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
F6F931A3203F067100B50CAC /* Build configuration list for PBXProject "Munchkin" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
F6F931B6203F067100B50CAC /* Debug */,
|
||||||
|
F6F931B7203F067100B50CAC /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
F6F931B8203F067100B50CAC /* Build configuration list for PBXNativeTarget "Munchkin" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
F6F931B9203F067100B50CAC /* Debug */,
|
||||||
|
F6F931BA203F067100B50CAC /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = F6F931A0203F067100B50CAC /* Project object */;
|
||||||
|
}
|
7
Munchkin.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
Munchkin.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:Munchkin.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Bucket
|
||||||
|
type = "1"
|
||||||
|
version = "2.0">
|
||||||
|
</Bucket>
|
@ -0,0 +1,14 @@
|
|||||||
|
<?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>SchemeUserState</key>
|
||||||
|
<dict>
|
||||||
|
<key>Munchkin.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
22
Munchkin/Ability.swift
Normal file
22
Munchkin/Ability.swift
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//
|
||||||
|
// Ability.swift
|
||||||
|
// Munchkin
|
||||||
|
//
|
||||||
|
// Created by Peter Terpstra on 2/24/18.
|
||||||
|
// Copyright © 2018 Peter Terpstra. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
class Ability {
|
||||||
|
var type: String
|
||||||
|
var properties: [String:Any]?
|
||||||
|
init(type: String) {
|
||||||
|
self.type = type
|
||||||
|
properties = nil
|
||||||
|
}
|
||||||
|
init(type: String, properties: [String:Any]) {
|
||||||
|
self.type = type
|
||||||
|
self.properties = properties
|
||||||
|
}
|
||||||
|
}
|
37
Munchkin/AffectsSelectController.swift
Normal file
37
Munchkin/AffectsSelectController.swift
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
//
|
||||||
|
// AffectsSelectController.swift
|
||||||
|
// Munchkin
|
||||||
|
//
|
||||||
|
// Created by Peter Terpstra on 2/24/18.
|
||||||
|
// Copyright © 2018 Peter Terpstra. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Cocoa
|
||||||
|
|
||||||
|
class AffectsSelectController: NSViewController {
|
||||||
|
|
||||||
|
@IBOutlet weak var affectsMenu: NSPopUpButton!
|
||||||
|
|
||||||
|
override func viewDidLoad() {
|
||||||
|
super.viewDidLoad()
|
||||||
|
// Do view setup here.
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func setButtonClicked(_ sender: Any) {
|
||||||
|
if affectsMenu.titleOfSelectedItem != nil && currentCard != nil {
|
||||||
|
let selection = affectsMenu.titleOfSelectedItem!
|
||||||
|
let card = currentCard!
|
||||||
|
switch (selection) {
|
||||||
|
case "Player":
|
||||||
|
card.affects=Side.Player
|
||||||
|
case "Monster":
|
||||||
|
card.affects=Side.Monster
|
||||||
|
default: break
|
||||||
|
}
|
||||||
|
playCards.append(card)
|
||||||
|
NotificationCenter.default.post(name: Notification.Name(rawValue: "update"), object: self)
|
||||||
|
currentCard=nil
|
||||||
|
self.dismiss(self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
26
Munchkin/AppDelegate.swift
Normal file
26
Munchkin/AppDelegate.swift
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//
|
||||||
|
// AppDelegate.swift
|
||||||
|
// Munchkin
|
||||||
|
//
|
||||||
|
// Created by Peter Terpstra on 2/22/18.
|
||||||
|
// Copyright © 2018 Peter Terpstra. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Cocoa
|
||||||
|
|
||||||
|
@NSApplicationMain
|
||||||
|
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||||
|
// Insert code here to initialize your application
|
||||||
|
}
|
||||||
|
|
||||||
|
func applicationWillTerminate(_ aNotification: Notification) {
|
||||||
|
// Insert code here to tear down your application
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
58
Munchkin/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
58
Munchkin/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"size" : "16x16",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"size" : "16x16",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"size" : "32x32",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"size" : "32x32",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"size" : "128x128",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"size" : "128x128",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"size" : "256x256",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"size" : "256x256",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"size" : "512x512",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"size" : "512x512",
|
||||||
|
"scale" : "2x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
1184
Munchkin/Base.lproj/Main.storyboard
Normal file
1184
Munchkin/Base.lproj/Main.storyboard
Normal file
File diff suppressed because it is too large
Load Diff
132
Munchkin/Card.swift
Normal file
132
Munchkin/Card.swift
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
//
|
||||||
|
// Card.swift
|
||||||
|
// Munchkin
|
||||||
|
//
|
||||||
|
// Created by Peter Terpstra on 2/23/18.
|
||||||
|
// Copyright © 2018 Peter Terpstra. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
class Card {
|
||||||
|
let type: CardType
|
||||||
|
let description: String
|
||||||
|
var affects: Side?
|
||||||
|
let strength: Int?
|
||||||
|
let treasures: Int?
|
||||||
|
let abilities:[Ability]?
|
||||||
|
let big:Bool?
|
||||||
|
let kind:WeaponKind?
|
||||||
|
var affectsString: String {
|
||||||
|
get {
|
||||||
|
if affects != nil {
|
||||||
|
switch (affects!) {
|
||||||
|
case Side.Player:
|
||||||
|
return "Player"
|
||||||
|
case Side.Monster:
|
||||||
|
return "Monster"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var strengthString: String {
|
||||||
|
get {
|
||||||
|
if strength != nil {
|
||||||
|
let strength=self.strength!
|
||||||
|
if strength > 0 {
|
||||||
|
return "+\(strength)"
|
||||||
|
} else {
|
||||||
|
return "\(strength)"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
init(description: String, abilities:[Ability],race:Bool) {
|
||||||
|
if race {
|
||||||
|
self.type=CardType.Race
|
||||||
|
} else {
|
||||||
|
self.type=CardType.Class
|
||||||
|
}
|
||||||
|
self.description=description
|
||||||
|
affects=nil
|
||||||
|
strength=nil
|
||||||
|
treasures=nil
|
||||||
|
self.abilities=abilities
|
||||||
|
self.big=nil
|
||||||
|
self.kind=nil
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
init(description: String, abilities:[Ability]) {
|
||||||
|
self.type=CardType.Class
|
||||||
|
self.description=description
|
||||||
|
affects=nil
|
||||||
|
strength=nil
|
||||||
|
treasures=nil
|
||||||
|
self.abilities=abilities
|
||||||
|
self.big=nil
|
||||||
|
self.kind=nil
|
||||||
|
}
|
||||||
|
|
||||||
|
init(description: String, strength: Int) {
|
||||||
|
self.type=CardType.OneUse
|
||||||
|
self.description=description
|
||||||
|
self.strength=strength
|
||||||
|
treasures=nil
|
||||||
|
abilities=nil
|
||||||
|
self.big=nil
|
||||||
|
self.kind=nil
|
||||||
|
}
|
||||||
|
|
||||||
|
init(description: String, strength: Int, big:Bool, kind:WeaponKind) {
|
||||||
|
self.type=CardType.OneUse
|
||||||
|
self.description=description
|
||||||
|
self.strength=strength
|
||||||
|
treasures=nil
|
||||||
|
abilities=nil
|
||||||
|
self.affects=Side.Player
|
||||||
|
self.big=big
|
||||||
|
self.kind=kind
|
||||||
|
}
|
||||||
|
|
||||||
|
init(description: String, strength: Int, affects: Side) {
|
||||||
|
self.type=CardType.OneUse
|
||||||
|
self.description=description
|
||||||
|
self.strength=strength
|
||||||
|
self.affects=affects
|
||||||
|
treasures=nil
|
||||||
|
abilities=nil
|
||||||
|
self.big=nil
|
||||||
|
self.kind=nil
|
||||||
|
}
|
||||||
|
|
||||||
|
init(description: String, strength: Int, treasures: Int, abilities:[Ability]) {
|
||||||
|
type=CardType.Monster
|
||||||
|
self.description=description
|
||||||
|
self.strength=strength
|
||||||
|
affects=nil
|
||||||
|
self.treasures=treasures
|
||||||
|
self.abilities=abilities
|
||||||
|
self.big=nil
|
||||||
|
self.kind=nil
|
||||||
|
}
|
||||||
|
|
||||||
|
init(description: String, strength: Int, treasures: Int) {
|
||||||
|
self.type=CardType.Monster
|
||||||
|
self.description=description
|
||||||
|
self.strength=strength
|
||||||
|
affects=nil
|
||||||
|
self.treasures=treasures
|
||||||
|
self.abilities=nil
|
||||||
|
self.big=nil
|
||||||
|
self.kind=nil
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
34
Munchkin/CardSelectController.swift
Normal file
34
Munchkin/CardSelectController.swift
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
//
|
||||||
|
// CardSelectController.swift
|
||||||
|
// Munchkin
|
||||||
|
//
|
||||||
|
// Created by Peter Terpstra on 2/23/18.
|
||||||
|
// Copyright © 2018 Peter Terpstra. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Cocoa
|
||||||
|
|
||||||
|
class CardSelectController: NSViewController {
|
||||||
|
|
||||||
|
@IBOutlet weak var cardMenu: NSPopUpButton!
|
||||||
|
|
||||||
|
override func viewDidLoad() {
|
||||||
|
super.viewDidLoad()
|
||||||
|
|
||||||
|
for card in cards {
|
||||||
|
cardMenu.addItem(withTitle: card.description)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override var representedObject: Any? {
|
||||||
|
didSet {
|
||||||
|
// Update the view, if already loaded.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func addButtonClicked(_ sender: Any) {
|
||||||
|
handCards.append(cards[cardMenu.indexOfSelectedItem])
|
||||||
|
NotificationCenter.default.post(name: Notification.Name(rawValue: "update"), object: self)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
20
Munchkin/CardType.swift
Normal file
20
Munchkin/CardType.swift
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
//
|
||||||
|
// CardType.swift
|
||||||
|
// Munchkin
|
||||||
|
//
|
||||||
|
// Created by Peter Terpstra on 2/23/18.
|
||||||
|
// Copyright © 2018 Peter Terpstra. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
enum CardType:String {
|
||||||
|
case Weapon = "Weapon"
|
||||||
|
case Curse = "Curse"
|
||||||
|
case OneUse = "One Use"
|
||||||
|
case None = ""
|
||||||
|
case Monster = "Monster"
|
||||||
|
case Item = "Item"
|
||||||
|
case Class = "Class"
|
||||||
|
case Race = "Race"
|
||||||
|
}
|
42
Munchkin/Global.swift
Normal file
42
Munchkin/Global.swift
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
//
|
||||||
|
// Global.swift
|
||||||
|
// Munchkin
|
||||||
|
//
|
||||||
|
// Created by Peter Terpstra on 2/23/18.
|
||||||
|
// Copyright © 2018 Peter Terpstra. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
let cards = [
|
||||||
|
Card(description: "Freezing Explosive Potion", strength: 3),
|
||||||
|
Card(description: "Nasty Tasting Sports Drink", strength: 2),
|
||||||
|
Card(description: "Electric Radioactive Acid Potion", strength: 5),
|
||||||
|
Card(description: "Potion of Idiotic Bravery", strength: 2),
|
||||||
|
Card(description: "Magic Missile", strength: 5),
|
||||||
|
Card(description: "Flaming Poison Potion", strength: 3),
|
||||||
|
Card(description: "Sleep Potion", strength: 2),
|
||||||
|
Card(description: "Pretty Ballons", strength: 5),
|
||||||
|
Card(description: "Cotion of Ponfusion", strength: 3),
|
||||||
|
Card(description: "Potion of Halitosis", strength: 2),
|
||||||
|
Card(description: "Chainsaw of Bloody Dismemberment", strength: 3, big:false, kind: WeaponKind.TwoHands),
|
||||||
|
Card(description: "Flaming Armor", strength: 2, big:false, kind:WeaponKind.Armor),
|
||||||
|
Card(description: "Buckler of Swashing", strength: 2, big:false, kind:WeaponKind.OneHand),
|
||||||
|
Card(description: "Slimy Armor", strength: 1, big:false, kind:WeaponKind.Armor),
|
||||||
|
Card(description: "Spiky Knees", strength: 1, big:false, kind:WeaponKind.None),
|
||||||
|
Card(description: "Helm of Courage", strength: 1, big:false, kind:WeaponKind.Headgear),
|
||||||
|
Card(description: "Boots of Butt-Kicking", strength: 2, big:false, kind:WeaponKind.Footgear),
|
||||||
|
Card(description: "Eleven-Foot Pole", strength: 1, big:false, kind:WeaponKind.TwoHands),
|
||||||
|
Card(description: "Sneaky Bastard Sword", strength: 2, big:false, kind:WeaponKind.OneHand),
|
||||||
|
Card(description: "Really Impressive Title", strength: 3, big:false, kind:WeaponKind.None),
|
||||||
|
Card(description: "Huge Rock", strength: 3, big:true, kind:WeaponKind.None),
|
||||||
|
Card(description: "Leather Armor", strength: 1, big:false, kind:WeaponKind.Armor),
|
||||||
|
Card(description: "Rat on a Stick", strength: 1, big:false, kind:WeaponKind.None),
|
||||||
|
Card(description: "Baby", strength: -5, affects: Side.Monster),
|
||||||
|
Card(description: "Shrieking Geek", strength: 6, treasures: 2, abilities: [Ability(type: "Strength", properties:["Warrior":5])])
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
var handCards:[Card] = []
|
||||||
|
var playCards:[Card] = []
|
||||||
|
var currentCard:Card? = nil
|
32
Munchkin/Info.plist
Normal file
32
Munchkin/Info.plist
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?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>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string></string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>$(PRODUCT_NAME)</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||||
|
<key>NSHumanReadableCopyright</key>
|
||||||
|
<string>Copyright © 2018 Peter Terpstra. All rights reserved.</string>
|
||||||
|
<key>NSMainStoryboardFile</key>
|
||||||
|
<string>Main</string>
|
||||||
|
<key>NSPrincipalClass</key>
|
||||||
|
<string>NSApplication</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
10
Munchkin/Munchkin.entitlements
Normal file
10
Munchkin/Munchkin.entitlements
Normal file
@ -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>com.apple.security.app-sandbox</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.files.user-selected.read-only</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
14
Munchkin/Side.swift
Normal file
14
Munchkin/Side.swift
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
//
|
||||||
|
// Side.swift
|
||||||
|
// Munchkin
|
||||||
|
//
|
||||||
|
// Created by Peter Terpstra on 2/23/18.
|
||||||
|
// Copyright © 2018 Peter Terpstra. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
enum Side {
|
||||||
|
case Player
|
||||||
|
case Monster
|
||||||
|
}
|
298
Munchkin/ViewController.swift
Normal file
298
Munchkin/ViewController.swift
Normal file
@ -0,0 +1,298 @@
|
|||||||
|
//
|
||||||
|
// ViewController.swift
|
||||||
|
// Munchkin
|
||||||
|
//
|
||||||
|
// Created by Peter Terpstra on 2/22/18.
|
||||||
|
// Copyright © 2018 Peter Terpstra. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Cocoa
|
||||||
|
|
||||||
|
class ViewController: NSViewController {
|
||||||
|
|
||||||
|
@IBOutlet weak var playerLevelLabel: NSTextField!
|
||||||
|
@IBOutlet weak var playerScoreLabel: NSTextField!
|
||||||
|
@IBOutlet weak var monsterScoreLabel: NSTextField!
|
||||||
|
@IBOutlet weak var handCardsTable: NSTableView!
|
||||||
|
@IBOutlet weak var playCardsTable: NSTableView!
|
||||||
|
@IBOutlet weak var currentMonsterLabel: NSTextField!
|
||||||
|
@IBOutlet weak var statusLabel: NSTextField!
|
||||||
|
|
||||||
|
var playerLevel = 1
|
||||||
|
var playerScore = 1
|
||||||
|
var monsterScore = 0
|
||||||
|
var currentMonster = ""
|
||||||
|
var status = ""
|
||||||
|
var monsterCard:Card? = nil
|
||||||
|
|
||||||
|
var gameInProgress = true
|
||||||
|
let forcePlayer = true
|
||||||
|
|
||||||
|
override func viewDidLoad() {
|
||||||
|
super.viewDidLoad()
|
||||||
|
|
||||||
|
handCardsTable.delegate = self
|
||||||
|
handCardsTable.dataSource = self
|
||||||
|
playCardsTable.delegate = self
|
||||||
|
playCardsTable.dataSource = self
|
||||||
|
|
||||||
|
NotificationCenter.default.addObserver(self, selector: #selector(updateNotification(notification:)), name: NSNotification.Name(rawValue: "update"), object: nil)
|
||||||
|
newGameClicked(self)
|
||||||
|
}
|
||||||
|
|
||||||
|
override var representedObject: Any? {
|
||||||
|
didSet {
|
||||||
|
// Update the view, if already loaded.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func reloadCards() {
|
||||||
|
handCardsTable.reloadData()
|
||||||
|
playCardsTable.reloadData()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func updateLabels() {
|
||||||
|
playerLevelLabel.integerValue = playerLevel
|
||||||
|
playerScoreLabel.integerValue = playerScore
|
||||||
|
monsterScoreLabel.integerValue = monsterScore
|
||||||
|
currentMonsterLabel.stringValue = currentMonster
|
||||||
|
statusLabel.stringValue = status
|
||||||
|
}
|
||||||
|
|
||||||
|
func calculateStats() {
|
||||||
|
playerScore=playerLevel
|
||||||
|
monsterScore=0
|
||||||
|
monsterCard=nil
|
||||||
|
var monsterModifiers:[Card] = []
|
||||||
|
var playerModifiers:[Card] = []
|
||||||
|
for card in playCards {
|
||||||
|
switch(card.type) {
|
||||||
|
case .Monster:
|
||||||
|
monsterCard = card
|
||||||
|
case .OneUse:
|
||||||
|
switch (card.affects!) {
|
||||||
|
case .Player:
|
||||||
|
playerModifiers.append(card)
|
||||||
|
case .Monster:
|
||||||
|
monsterModifiers.append(card)
|
||||||
|
}
|
||||||
|
case .Weapon:
|
||||||
|
playerModifiers.append(card)
|
||||||
|
default: break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for card in playerModifiers {
|
||||||
|
playerScore += card.strength!
|
||||||
|
}
|
||||||
|
|
||||||
|
if monsterCard != nil {
|
||||||
|
monsterScore=monsterCard!.strength!
|
||||||
|
for card in monsterModifiers {
|
||||||
|
monsterScore += card.strength!
|
||||||
|
}
|
||||||
|
currentMonster = monsterCard!.description
|
||||||
|
} else {
|
||||||
|
currentMonster = ""
|
||||||
|
}
|
||||||
|
if playerLevel == 10 {
|
||||||
|
status="You win the game!"
|
||||||
|
gameInProgress=false
|
||||||
|
}
|
||||||
|
updateLabels()
|
||||||
|
}
|
||||||
|
|
||||||
|
func update() {
|
||||||
|
reloadCards()
|
||||||
|
calculateStats()
|
||||||
|
updateLabels()
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc func updateNotification(notification: NSNotification) {
|
||||||
|
update()
|
||||||
|
}
|
||||||
|
|
||||||
|
func openAffectsSelect() {
|
||||||
|
let myStoryboard = NSStoryboard(name: NSStoryboard.Name(rawValue: "Main"),bundle: nil)
|
||||||
|
if let vc = myStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "AffectsSelect")) as? AffectsSelectController {
|
||||||
|
let myWindow = NSWindow(contentViewController: vc)
|
||||||
|
myWindow.makeKeyAndOrderFront(self)
|
||||||
|
let controller = NSWindowController(window: myWindow)
|
||||||
|
controller.showWindow(self)
|
||||||
|
} else {
|
||||||
|
print("Could not open AffectsSelect")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func openCardSelect() {
|
||||||
|
let myStoryboard = NSStoryboard(name: NSStoryboard.Name(rawValue: "Main"),bundle: nil)
|
||||||
|
if let vc = myStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "CardSelect")) as? CardSelectController {
|
||||||
|
let myWindow = NSWindow(contentViewController: vc)
|
||||||
|
myWindow.makeKeyAndOrderFront(self)
|
||||||
|
let controller = NSWindowController(window: myWindow)
|
||||||
|
controller.showWindow(self)
|
||||||
|
} else {
|
||||||
|
print("Could not open CardSelect")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func newGameClicked(_ sender: Any) {
|
||||||
|
playerLevel = 1
|
||||||
|
playerScore = 1
|
||||||
|
monsterScore = 0
|
||||||
|
handCards = []
|
||||||
|
playCards = []
|
||||||
|
status=""
|
||||||
|
gameInProgress=true
|
||||||
|
update()
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func handAddClicked(_ sender: Any) {
|
||||||
|
if gameInProgress {
|
||||||
|
openCardSelect()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func handRemoveClicked(_ sender: Any) {
|
||||||
|
if gameInProgress {
|
||||||
|
let index = handCardsTable.selectedRow
|
||||||
|
if index != -1 {
|
||||||
|
handCards.remove(at:index)
|
||||||
|
reloadCards()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func handMoveClicked(_ sender: Any) {
|
||||||
|
if gameInProgress {
|
||||||
|
let index = handCardsTable.selectedRow
|
||||||
|
if index != -1 {
|
||||||
|
let card = handCards[index]
|
||||||
|
if card.affects == nil && card.type != .Monster {
|
||||||
|
currentCard=card
|
||||||
|
handCards.remove(at: index)
|
||||||
|
if forcePlayer {
|
||||||
|
if card.affects == nil {
|
||||||
|
card.affects=Side.Player
|
||||||
|
playCards.append(card)
|
||||||
|
}
|
||||||
|
reloadCards()
|
||||||
|
} else {
|
||||||
|
openAffectsSelect()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
playCards.append(card)
|
||||||
|
handCards.remove(at: index)
|
||||||
|
reloadCards()
|
||||||
|
calculateStats()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func playMoveClicked(_ sender: Any) {
|
||||||
|
if gameInProgress {
|
||||||
|
let index = playCardsTable.selectedRow
|
||||||
|
if index != -1 {
|
||||||
|
let card = playCards[index]
|
||||||
|
playCards.remove(at: index)
|
||||||
|
handCards.append(card)
|
||||||
|
reloadCards()
|
||||||
|
}
|
||||||
|
calculateStats()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func fightButtonClicked(_ sender: Any) {
|
||||||
|
if gameInProgress {
|
||||||
|
if monsterCard != nil {
|
||||||
|
if playerScore > monsterScore {
|
||||||
|
status="You win the battle! Draw \(monsterCard!.treasures!) treasures"
|
||||||
|
playerLevel+=1
|
||||||
|
} else {
|
||||||
|
status="You lose"
|
||||||
|
}
|
||||||
|
var newPlayCards:[Card]=[]
|
||||||
|
for card in playCards {
|
||||||
|
if card.type != .OneUse && card.type != .Monster {
|
||||||
|
newPlayCards.append(card)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
playCards=newPlayCards
|
||||||
|
monsterCard=nil
|
||||||
|
} else {
|
||||||
|
if status == "Uhh, there's no monster to fight" {
|
||||||
|
status = "I told you, there's no monster"
|
||||||
|
} else if status == "I told you, there's no monster" {
|
||||||
|
status = "SERIOUSLY! THERE'S NO MONSTER!"
|
||||||
|
} else if status != "SERIOUSLY! THERE'S NO MONSTER!" {
|
||||||
|
status = "Uhh, there's no monster to fight"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
update()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension ViewController: NSTableViewDataSource {
|
||||||
|
|
||||||
|
func numberOfRows(in tableView: NSTableView) -> Int {
|
||||||
|
if tableView == handCardsTable {
|
||||||
|
return handCards.count
|
||||||
|
} else if tableView == playCardsTable {
|
||||||
|
return playCards.count
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
extension ViewController: NSTableViewDelegate {
|
||||||
|
|
||||||
|
fileprivate enum CellIdentifiers {
|
||||||
|
static let NameCellHand = "NameCellHandID"
|
||||||
|
static let NameCellPlay = "NameCellPlayID"
|
||||||
|
static let AffectsCell = "AffectsCellID"
|
||||||
|
}
|
||||||
|
|
||||||
|
func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
|
||||||
|
|
||||||
|
var text: String = ""
|
||||||
|
var cellIdentifier: String = ""
|
||||||
|
|
||||||
|
switch tableView {
|
||||||
|
case handCardsTable:
|
||||||
|
text=handCards[row].description
|
||||||
|
cellIdentifier = CellIdentifiers.NameCellHand
|
||||||
|
case playCardsTable:
|
||||||
|
switch tableColumn {
|
||||||
|
case tableView.tableColumns[0]?:
|
||||||
|
text=playCards[row].description
|
||||||
|
cellIdentifier = CellIdentifiers.NameCellPlay
|
||||||
|
case tableView.tableColumns[1]?:
|
||||||
|
if playCards[row].strength != nil && playCards[row].affects != nil {
|
||||||
|
let strength=playCards[row].strengthString
|
||||||
|
let affects=playCards[row].affectsString
|
||||||
|
text="\(affects) (\(strength))"
|
||||||
|
} else {
|
||||||
|
text=""
|
||||||
|
}
|
||||||
|
cellIdentifier = CellIdentifiers.AffectsCell
|
||||||
|
case .none:
|
||||||
|
text=""
|
||||||
|
case .some(_):
|
||||||
|
text=""
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
text=""
|
||||||
|
}
|
||||||
|
|
||||||
|
if let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: cellIdentifier), owner: nil) as? NSTableCellView {
|
||||||
|
cell.textField?.stringValue = text
|
||||||
|
return cell
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
18
Munchkin/WeaponKind.swift
Normal file
18
Munchkin/WeaponKind.swift
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//
|
||||||
|
// WeaponKind.swift
|
||||||
|
// Munchkin
|
||||||
|
//
|
||||||
|
// Created by Peter Terpstra on 2/24/18.
|
||||||
|
// Copyright © 2018 Peter Terpstra. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
enum WeaponKind {
|
||||||
|
case TwoHands
|
||||||
|
case OneHand
|
||||||
|
case Armor
|
||||||
|
case Headgear
|
||||||
|
case Footgear
|
||||||
|
case None
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user