mirror of
https://github.com/neon443/CookieSwifter.git
synced 2026-03-11 07:09:11 +00:00
omg the lock in is crazy
This commit is contained in:
600
CookieSwifter/CookieSwifter.xcodeproj/project.pbxproj
Normal file
600
CookieSwifter/CookieSwifter.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,600 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 77;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
A912A6112D10109C00703A89 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = A912A5F72D10109500703A89 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = A912A5FE2D10109500703A89;
|
||||
remoteInfo = CookieSwifter;
|
||||
};
|
||||
A912A61B2D10109C00703A89 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = A912A5F72D10109500703A89 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = A912A5FE2D10109500703A89;
|
||||
remoteInfo = CookieSwifter;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
A912A5FF2D10109500703A89 /* CookieSwifter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CookieSwifter.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A912A6102D10109C00703A89 /* CookieSwifterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CookieSwifterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A912A61A2D10109C00703A89 /* CookieSwifterUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CookieSwifterUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFileSystemSynchronizedRootGroup section */
|
||||
A912A6012D10109500703A89 /* CookieSwifter */ = {
|
||||
isa = PBXFileSystemSynchronizedRootGroup;
|
||||
path = CookieSwifter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A912A6132D10109C00703A89 /* CookieSwifterTests */ = {
|
||||
isa = PBXFileSystemSynchronizedRootGroup;
|
||||
path = CookieSwifterTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A912A61D2D10109C00703A89 /* CookieSwifterUITests */ = {
|
||||
isa = PBXFileSystemSynchronizedRootGroup;
|
||||
path = CookieSwifterUITests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXFileSystemSynchronizedRootGroup section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
A912A5FC2D10109500703A89 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
A912A60D2D10109C00703A89 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
A912A6172D10109C00703A89 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
A912A5F62D10109500703A89 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A912A6012D10109500703A89 /* CookieSwifter */,
|
||||
A912A6132D10109C00703A89 /* CookieSwifterTests */,
|
||||
A912A61D2D10109C00703A89 /* CookieSwifterUITests */,
|
||||
A912A6002D10109500703A89 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A912A6002D10109500703A89 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A912A5FF2D10109500703A89 /* CookieSwifter.app */,
|
||||
A912A6102D10109C00703A89 /* CookieSwifterTests.xctest */,
|
||||
A912A61A2D10109C00703A89 /* CookieSwifterUITests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
A912A5FE2D10109500703A89 /* CookieSwifter */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = A912A6242D10109C00703A89 /* Build configuration list for PBXNativeTarget "CookieSwifter" */;
|
||||
buildPhases = (
|
||||
A912A5FB2D10109500703A89 /* Sources */,
|
||||
A912A5FC2D10109500703A89 /* Frameworks */,
|
||||
A912A5FD2D10109500703A89 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
fileSystemSynchronizedGroups = (
|
||||
A912A6012D10109500703A89 /* CookieSwifter */,
|
||||
);
|
||||
name = CookieSwifter;
|
||||
packageProductDependencies = (
|
||||
);
|
||||
productName = CookieSwifter;
|
||||
productReference = A912A5FF2D10109500703A89 /* CookieSwifter.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
A912A60F2D10109C00703A89 /* CookieSwifterTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = A912A6272D10109C00703A89 /* Build configuration list for PBXNativeTarget "CookieSwifterTests" */;
|
||||
buildPhases = (
|
||||
A912A60C2D10109C00703A89 /* Sources */,
|
||||
A912A60D2D10109C00703A89 /* Frameworks */,
|
||||
A912A60E2D10109C00703A89 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
A912A6122D10109C00703A89 /* PBXTargetDependency */,
|
||||
);
|
||||
fileSystemSynchronizedGroups = (
|
||||
A912A6132D10109C00703A89 /* CookieSwifterTests */,
|
||||
);
|
||||
name = CookieSwifterTests;
|
||||
packageProductDependencies = (
|
||||
);
|
||||
productName = CookieSwifterTests;
|
||||
productReference = A912A6102D10109C00703A89 /* CookieSwifterTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
A912A6192D10109C00703A89 /* CookieSwifterUITests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = A912A62A2D10109C00703A89 /* Build configuration list for PBXNativeTarget "CookieSwifterUITests" */;
|
||||
buildPhases = (
|
||||
A912A6162D10109C00703A89 /* Sources */,
|
||||
A912A6172D10109C00703A89 /* Frameworks */,
|
||||
A912A6182D10109C00703A89 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
A912A61C2D10109C00703A89 /* PBXTargetDependency */,
|
||||
);
|
||||
fileSystemSynchronizedGroups = (
|
||||
A912A61D2D10109C00703A89 /* CookieSwifterUITests */,
|
||||
);
|
||||
name = CookieSwifterUITests;
|
||||
packageProductDependencies = (
|
||||
);
|
||||
productName = CookieSwifterUITests;
|
||||
productReference = A912A61A2D10109C00703A89 /* CookieSwifterUITests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.ui-testing";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
A912A5F72D10109500703A89 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = 1;
|
||||
LastSwiftUpdateCheck = 1620;
|
||||
LastUpgradeCheck = 1620;
|
||||
TargetAttributes = {
|
||||
A912A5FE2D10109500703A89 = {
|
||||
CreatedOnToolsVersion = 16.2;
|
||||
};
|
||||
A912A60F2D10109C00703A89 = {
|
||||
CreatedOnToolsVersion = 16.2;
|
||||
TestTargetID = A912A5FE2D10109500703A89;
|
||||
};
|
||||
A912A6192D10109C00703A89 = {
|
||||
CreatedOnToolsVersion = 16.2;
|
||||
TestTargetID = A912A5FE2D10109500703A89;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = A912A5FA2D10109500703A89 /* Build configuration list for PBXProject "CookieSwifter" */;
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = A912A5F62D10109500703A89;
|
||||
minimizedProjectReferenceProxies = 1;
|
||||
preferredProjectObjectVersion = 77;
|
||||
productRefGroup = A912A6002D10109500703A89 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
A912A5FE2D10109500703A89 /* CookieSwifter */,
|
||||
A912A60F2D10109C00703A89 /* CookieSwifterTests */,
|
||||
A912A6192D10109C00703A89 /* CookieSwifterUITests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
A912A5FD2D10109500703A89 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
A912A60E2D10109C00703A89 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
A912A6182D10109C00703A89 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
A912A5FB2D10109500703A89 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
A912A60C2D10109C00703A89 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
A912A6162D10109C00703A89 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
A912A6122D10109C00703A89 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = A912A5FE2D10109500703A89 /* CookieSwifter */;
|
||||
targetProxy = A912A6112D10109C00703A89 /* PBXContainerItemProxy */;
|
||||
};
|
||||
A912A61C2D10109C00703A89 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = A912A5FE2D10109500703A89 /* CookieSwifter */;
|
||||
targetProxy = A912A61B2D10109C00703A89 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
A912A6222D10109C00703A89 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
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;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu17;
|
||||
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;
|
||||
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
A912A6232D10109C00703A89 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
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;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu17;
|
||||
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;
|
||||
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
A912A6252D10109C00703A89 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_ENTITLEMENTS = CookieSwifter/CookieSwifter.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"CookieSwifter/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = 8626DL2GW3;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
|
||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
|
||||
"INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
|
||||
"INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES;
|
||||
"INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES;
|
||||
"INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES;
|
||||
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault;
|
||||
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
||||
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 15.1;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.neon443.CookieSwifter;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SDKROOT = auto;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2,7";
|
||||
XROS_DEPLOYMENT_TARGET = 2.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
A912A6262D10109C00703A89 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_ENTITLEMENTS = CookieSwifter/CookieSwifter.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"CookieSwifter/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = 8626DL2GW3;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
|
||||
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
|
||||
"INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
|
||||
"INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES;
|
||||
"INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES;
|
||||
"INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES;
|
||||
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault;
|
||||
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
||||
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 15.1;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.neon443.CookieSwifter;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SDKROOT = auto;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2,7";
|
||||
XROS_DEPLOYMENT_TARGET = 2.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
A912A6282D10109C00703A89 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 8626DL2GW3;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 18.2;
|
||||
MACOSX_DEPLOYMENT_TARGET = 15.1;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.neon443.CookieSwifterTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = auto;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
|
||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2,7";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CookieSwifter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/CookieSwifter";
|
||||
XROS_DEPLOYMENT_TARGET = 2.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
A912A6292D10109C00703A89 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 8626DL2GW3;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 18.2;
|
||||
MACOSX_DEPLOYMENT_TARGET = 15.1;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.neon443.CookieSwifterTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = auto;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
|
||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2,7";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CookieSwifter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/CookieSwifter";
|
||||
XROS_DEPLOYMENT_TARGET = 2.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
A912A62B2D10109C00703A89 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 8626DL2GW3;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 18.2;
|
||||
MACOSX_DEPLOYMENT_TARGET = 15.1;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.neon443.CookieSwifterUITests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = auto;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
|
||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2,7";
|
||||
TEST_TARGET_NAME = CookieSwifter;
|
||||
XROS_DEPLOYMENT_TARGET = 2.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
A912A62C2D10109C00703A89 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 8626DL2GW3;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 18.2;
|
||||
MACOSX_DEPLOYMENT_TARGET = 15.1;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.neon443.CookieSwifterUITests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = auto;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
|
||||
SWIFT_EMIT_LOC_STRINGS = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2,7";
|
||||
TEST_TARGET_NAME = CookieSwifter;
|
||||
XROS_DEPLOYMENT_TARGET = 2.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
A912A5FA2D10109500703A89 /* Build configuration list for PBXProject "CookieSwifter" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
A912A6222D10109C00703A89 /* Debug */,
|
||||
A912A6232D10109C00703A89 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
A912A6242D10109C00703A89 /* Build configuration list for PBXNativeTarget "CookieSwifter" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
A912A6252D10109C00703A89 /* Debug */,
|
||||
A912A6262D10109C00703A89 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
A912A6272D10109C00703A89 /* Build configuration list for PBXNativeTarget "CookieSwifterTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
A912A6282D10109C00703A89 /* Debug */,
|
||||
A912A6292D10109C00703A89 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
A912A62A2D10109C00703A89 /* Build configuration list for PBXNativeTarget "CookieSwifterUITests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
A912A62B2D10109C00703A89 /* Debug */,
|
||||
A912A62C2D10109C00703A89 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = A912A5F72D10109500703A89 /* Project object */;
|
||||
}
|
||||
7
CookieSwifter/CookieSwifter.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
CookieSwifter/CookieSwifter.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:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "tinted"
|
||||
}
|
||||
],
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "16x16"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "16x16"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "32x32"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "32x32"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "128x128"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "128x128"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "256x256"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "256x256"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "512x512"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "512x512"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
273
CookieSwifter/CookieSwifter/ContentView.swift
Normal file
273
CookieSwifter/CookieSwifter/ContentView.swift
Normal file
@@ -0,0 +1,273 @@
|
||||
//
|
||||
// ContentView.swift
|
||||
// CookieSwifter
|
||||
//
|
||||
// Created by Nihaal Sharma on 16/12/2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
@ObservedObject var gameManager: CookieGame
|
||||
@State private var selectedSave: String? = nil
|
||||
@State private var showSavedGames: Bool = false
|
||||
@State private var buyQuantity: Int = 1
|
||||
@State var gameName: String
|
||||
@State var showAchievemetns: Bool = false
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 10) {
|
||||
Text("\(gameManager.cookies)")
|
||||
.font(.largeTitle)
|
||||
.fontWeight(.bold)
|
||||
HStack {
|
||||
Text("Game Name")
|
||||
.font(.caption)
|
||||
.bold()
|
||||
TextField("", text: $gameName)
|
||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||
}
|
||||
.padding(.horizontal)
|
||||
|
||||
Picker("Buy", selection: $buyQuantity) {
|
||||
ForEach([1, 10, 100], id: \.self) { option in
|
||||
Text("\(option)").tag(option)
|
||||
}
|
||||
}
|
||||
.pickerStyle(SegmentedPickerStyle())
|
||||
.padding(.horizontal)
|
||||
.padding(.top)
|
||||
ItemsListView(gameManager: gameManager, buyQuantity: $buyQuantity)
|
||||
UpgradesListView(gameManager: gameManager)
|
||||
|
||||
Spacer()
|
||||
HStack {
|
||||
VStack {
|
||||
Button("Save Game") {
|
||||
let saveDate = "Saved \(Date().formatted())"
|
||||
gameManager.saveGame(name: gameName+saveDate)
|
||||
}
|
||||
.padding()
|
||||
.background(Color.green)
|
||||
.foregroundColor(.white)
|
||||
.cornerRadius(10)
|
||||
|
||||
Button("Load Game") {
|
||||
showSavedGames = true
|
||||
}
|
||||
.padding()
|
||||
.background(Color.blue)
|
||||
.foregroundColor(.white)
|
||||
.cornerRadius(10)
|
||||
}
|
||||
.sheet(isPresented: $showSavedGames) {
|
||||
SavedGamesListView(gameManager: gameManager, selectedSave: $selectedSave)
|
||||
}
|
||||
.onChange(of: selectedSave) { newValue in
|
||||
if let saveName = newValue {
|
||||
gameManager.loadGame(named: saveName)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
VStack {
|
||||
CookieTapView(gameManager: gameManager)
|
||||
Text("CPS: \(gameManager.cps)")
|
||||
.font(.headline)
|
||||
}
|
||||
Spacer()
|
||||
|
||||
AchievementButton(
|
||||
gameManager: gameManager,
|
||||
showAchievements: $showAchievemetns
|
||||
)
|
||||
}
|
||||
.padding(.horizontal)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SavedGamesListView: View {
|
||||
@ObservedObject var gameManager: CookieGame
|
||||
@Binding var selectedSave: String?
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
List {
|
||||
ForEach(gameManager.savedGames, id: \ .name) { save in
|
||||
HStack {
|
||||
VStack(alignment: .leading) {
|
||||
Text(save.name).font(.headline)
|
||||
Text("Cookies: \(save.cookies), CPS: \(save.cps)").font(.subheadline)
|
||||
Text("Items: \(save.items.count), Achievements: \(save.achievements.count)").font(.footnote)
|
||||
}
|
||||
Spacer()
|
||||
Button("Load") {
|
||||
selectedSave = save.name
|
||||
}
|
||||
.padding(5)
|
||||
.background(Color.orange)
|
||||
.foregroundColor(.white)
|
||||
.cornerRadius(5)
|
||||
}
|
||||
}
|
||||
.onDelete { indexSet in
|
||||
indexSet.map { gameManager.savedGames[$0].name }.forEach(gameManager.deleteGame(named:))
|
||||
}
|
||||
}
|
||||
.navigationTitle("Saved Games")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct CookieTapView: View {
|
||||
@ObservedObject var gameManager: CookieGame
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 10) {
|
||||
Button(action: {
|
||||
gameManager.cookies += 1
|
||||
gameManager.checkAchievements()
|
||||
}) {
|
||||
Text("🍪")
|
||||
.font(.system(size: 75))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
struct ItemsListView: View {
|
||||
@ObservedObject var gameManager: CookieGame
|
||||
@Binding var buyQuantity: Int
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
Text("Buy")
|
||||
.font(.footnote)
|
||||
Spacer()
|
||||
Text("Items")
|
||||
.font(.footnote)
|
||||
Spacer()
|
||||
Text("Sell")
|
||||
.font(.footnote)
|
||||
}
|
||||
.padding(.horizontal, 5)
|
||||
VStack(spacing: 10) {
|
||||
ForEach(gameManager.items.indices, id: \.self) { index in
|
||||
HStack(spacing: 10) {
|
||||
Button(action: {
|
||||
gameManager.buyItem(at: index, quantity: buyQuantity)
|
||||
}) {
|
||||
HStack {
|
||||
Text("\(gameManager.items[index].count) x \(gameManager.items[index].name)")
|
||||
Spacer()
|
||||
Text("🍪 \(gameManager.totalCost(of: index, quantity: buyQuantity))")
|
||||
.font(.caption2)
|
||||
}
|
||||
.padding(5)
|
||||
.background(Color.blue.opacity(0.2))
|
||||
.cornerRadius(10)
|
||||
}
|
||||
.disabled(gameManager.cookies < gameManager.totalCost(of: index, quantity: buyQuantity))
|
||||
// if gameManager.cookies < gameManager.totalCost(of: index, quantity: buyQuantity) {
|
||||
// Gauge(
|
||||
// value: gameManager.cookies,
|
||||
// in: 1..<gameManager
|
||||
// .totalCost(of: index, quantity: buyQuantity),
|
||||
// label: Text("d")
|
||||
// )
|
||||
// }
|
||||
|
||||
SellButton(
|
||||
gameManager: gameManager,
|
||||
index: index,
|
||||
buyQuantity: buyQuantity
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
struct SellButton: View {
|
||||
@ObservedObject var gameManager: CookieGame
|
||||
@State var index: Int
|
||||
@State var buyQuantity: Int
|
||||
|
||||
var body: some View {
|
||||
Button(action: {
|
||||
gameManager.sellItem(at: index, quantity: buyQuantity)
|
||||
}) {
|
||||
Text("🍪 \(gameManager.totalCost(of: index, quantity: buyQuantity) / 2)")
|
||||
.padding(5)
|
||||
.background(Color.red.opacity(0.2))
|
||||
.cornerRadius(10)
|
||||
}
|
||||
.disabled(gameManager.items[index].count < buyQuantity)
|
||||
}
|
||||
}
|
||||
struct UpgradesListView: View {
|
||||
@ObservedObject var gameManager: CookieGame
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 10) {
|
||||
Text("Upgrades")
|
||||
.font(.footnote)
|
||||
ForEach(gameManager.upgrades.indices, id: \.self) { index in
|
||||
Button(action: {
|
||||
gameManager.purchaseUpgrade(at: index)
|
||||
}) {
|
||||
HStack {
|
||||
Text(gameManager.upgrades[index].name)
|
||||
Text(gameManager.upgrades[index].description)
|
||||
Spacer()
|
||||
Text("🍪 \(gameManager.upgrades[index].cost)")
|
||||
}
|
||||
.padding(5)
|
||||
.background(gameManager.upgrades[index].isPurchased ? Color.green.opacity(0.2) : Color.gray.opacity(0.2))
|
||||
.cornerRadius(10)
|
||||
}
|
||||
.disabled(gameManager.cookies < gameManager.upgrades[index].cost || gameManager.upgrades[index].isPurchased)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
struct AchievementButton: View {
|
||||
@ObservedObject var gameManager: CookieGame
|
||||
@Binding var showAchievements: Bool
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 10) {
|
||||
Button(action: {
|
||||
showAchievements.toggle()
|
||||
}) {
|
||||
Text("\(gameManager.achievements.count) Achievements")
|
||||
.font(.title3)
|
||||
.padding(5)
|
||||
.background(Color.purple.opacity(0.2))
|
||||
.cornerRadius(10)
|
||||
}
|
||||
.sheet(isPresented: $showAchievements) {
|
||||
AchievementsView(achievements: gameManager.achievements)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
struct AchievementsView: View {
|
||||
let achievements: [Achievement]
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
List(achievements, id: \.title) { achievement in
|
||||
VStack(alignment: .leading) {
|
||||
Text(achievement.title)
|
||||
.font(.headline)
|
||||
Text(achievement.description)
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.gray)
|
||||
}
|
||||
}
|
||||
.navigationTitle("Achievements")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
199
CookieSwifter/CookieSwifter/CookieGame.swift
Normal file
199
CookieSwifter/CookieSwifter/CookieGame.swift
Normal file
@@ -0,0 +1,199 @@
|
||||
//
|
||||
// GameManager.swift
|
||||
// CookieSwifter
|
||||
//
|
||||
// Created by Nihaal Sharma on 16/12/2024.
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
|
||||
class CookieGame: ObservableObject {
|
||||
@Published var cookies: Int = 0
|
||||
@Published var cps: Int = 0
|
||||
@Published var savedGames: [SavedGame] = []
|
||||
@Published var items: [Item] = [
|
||||
Item(name: "Finger", cps: 1, baseCost: 10, count: 0),
|
||||
Item(name: "Chef", cps: 4, baseCost: 50, count: 0),
|
||||
Item(name: "Farm", cps: 16, baseCost: 200, count: 0),
|
||||
Item(name: "Mine", cps: 64, baseCost: 800, count: 0),
|
||||
Item(name: "Factory", cps: 256, baseCost: 3200, count: 0),
|
||||
Item(name: "Bank", cps: 1024, baseCost: 12800, count: 0)
|
||||
]
|
||||
@Published var upgrades: [Upgrade] = [
|
||||
Upgrade(name: "Golden Finger", description: "Double the CPS of fingers.", cost: 500, appliesTo: "Finger", isPurchased: false),
|
||||
Upgrade(name: "Farm Efficiency", description: "Farms are 50% more efficient.", cost: 2000, appliesTo: "Farm", isPurchased: false),
|
||||
Upgrade(name: "Double the Dough", description: "Doubles the CPS of all items.", cost: 10000, appliesTo: "All", isPurchased: false),
|
||||
Upgrade(name: "Banker’s Delight", description: "Banks generate 2x cookies.", cost: 50000, appliesTo: "Bank", isPurchased: false),
|
||||
Upgrade(name: "Efficient Farms", description: "Farms are 10% cheaper.", cost: 15000, appliesTo: "Farm", isPurchased: false),
|
||||
Upgrade(name: "Factory Booster", description: "Factories are 50% more efficient.", cost: 100000, appliesTo: "Factory", isPurchased: false),
|
||||
Upgrade(name: "Golden Era", description: "Triple CPS for 30 seconds.", cost: 200000, appliesTo: "Temporary", isPurchased: false)
|
||||
]
|
||||
@Published var achievements: [Achievement] = []
|
||||
|
||||
private let saveKey = "CookieGameSave"
|
||||
var timer: Timer?
|
||||
|
||||
func saveGame(name: String) {
|
||||
let save = SavedGame(
|
||||
name: name,
|
||||
cookies: cookies,
|
||||
cps: cps,
|
||||
items: items,
|
||||
achievements: achievements
|
||||
)
|
||||
savedGames.append(save)
|
||||
persistSavedGames()
|
||||
}
|
||||
|
||||
func loadGame(named name: String) {
|
||||
guard let save = savedGames.first(where: { $0.name == name }) else { return }
|
||||
cookies = save.cookies
|
||||
cps = save.cps
|
||||
items = save.items
|
||||
achievements = save.achievements
|
||||
}
|
||||
|
||||
func deleteGame(named name: String) {
|
||||
savedGames.removeAll { $0.name == name }
|
||||
persistSavedGames()
|
||||
}
|
||||
|
||||
private func persistSavedGames() {
|
||||
if let data = try? JSONEncoder().encode(savedGames) {
|
||||
UserDefaults.standard.set(data, forKey: saveKey)
|
||||
}
|
||||
}
|
||||
|
||||
func loadSavedGames() {
|
||||
guard let data = UserDefaults.standard.data(forKey: saveKey),
|
||||
let saves = try? JSONDecoder().decode([SavedGame].self, from: data) else { return }
|
||||
savedGames = saves
|
||||
}
|
||||
|
||||
init() {
|
||||
loadSavedGames()
|
||||
}
|
||||
|
||||
func startTimer() {
|
||||
if timer == nil {
|
||||
timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { _ in
|
||||
self.cookies += self.cps
|
||||
self.checkAchievements()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func buyItem(at index: Int, quantity: Int) {
|
||||
let cost = totalCost(of: index, quantity: quantity)
|
||||
guard cookies >= cost else { return }
|
||||
|
||||
cookies -= cost
|
||||
items[index].count += quantity
|
||||
cps += items[index].cps * quantity
|
||||
}
|
||||
|
||||
func sellItem(at index: Int, quantity: Int) {
|
||||
guard items[index].count >= quantity else { return }
|
||||
|
||||
items[index].count -= quantity
|
||||
cps -= items[index].cps * quantity
|
||||
let sellValue = totalCost(of: index, quantity: quantity) / 2
|
||||
cookies += sellValue
|
||||
}
|
||||
|
||||
func purchaseUpgrade(at index: Int) {
|
||||
let upgrade = upgrades[index]
|
||||
guard cookies >= upgrade.cost, !upgrade.isPurchased else { return }
|
||||
|
||||
if upgrade.appliesTo == "All" {
|
||||
for i in items.indices {
|
||||
items[i].cps *= 2
|
||||
}
|
||||
} else if upgrade.appliesTo == "Temporary" {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 30) {
|
||||
self.cps /= 3
|
||||
}
|
||||
cps *= 3
|
||||
} else if let itemIndex = items.firstIndex(where: { $0.name == upgrade.appliesTo }) {
|
||||
items[itemIndex].cps = Int(Double(items[itemIndex].cps) * (upgrade.name.contains("Efficiency") ? 1.5 : 2))
|
||||
}
|
||||
|
||||
cookies -= upgrade.cost
|
||||
upgrades[index].isPurchased = true
|
||||
}
|
||||
|
||||
func totalCost(of index: Int, quantity: Int) -> Int {
|
||||
var total = 0
|
||||
for i in 0..<quantity {
|
||||
total += Int(Double(items[index].baseCost) * pow(1.1, Double(items[index].count + i)))
|
||||
}
|
||||
return total
|
||||
}
|
||||
|
||||
func checkAchievements() {
|
||||
let achievementList = [
|
||||
Achievement(title: "Cookie Beginner", description: "Earn 100 cookies."),
|
||||
Achievement(title: "Cookie Enthusiast", description: "Earn 10,000 cookies."),
|
||||
Achievement(title: "Master Baker", description: "Earn 1,000,000 cookies."),
|
||||
Achievement(title: "Quick Clicker", description: "Tap the cookie 100 times in under 10 seconds."),
|
||||
Achievement(title: "Investment Master", description: "Own 10 of every item type."),
|
||||
Achievement(title: "Upgrade Collector", description: "Purchase all available upgrades."),
|
||||
Achievement(title: "Ultimate Tycoon", description: "Earn 10 billion cookies.")
|
||||
]
|
||||
|
||||
for achievement in achievementList {
|
||||
if !achievements.contains(where: { $0.title == achievement.title }) {
|
||||
switch achievement.title {
|
||||
case "Cookie Beginner" where cookies >= 100,
|
||||
"Cookie Enthusiast" where cookies >= 10000,
|
||||
"Master Baker" where cookies >= 1000000,
|
||||
"Quick Clicker" where cps >= 100,
|
||||
"Investment Master" where items.allSatisfy({ $0.count >= 10 }),
|
||||
"Upgrade Collector" where upgrades.allSatisfy({ $0.isPurchased }),
|
||||
"Ultimate Tycoon" where cookies >= 10000000000:
|
||||
achievements.append(achievement)
|
||||
default:
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Game State for Saving
|
||||
struct GameState: Codable {
|
||||
let cookies: Int
|
||||
let cps: Int
|
||||
let items: [Item]
|
||||
let upgrades: [Upgrade]
|
||||
let achievements: [Achievement]
|
||||
}
|
||||
|
||||
struct Item: Codable {
|
||||
let name: String
|
||||
var cps: Int
|
||||
let baseCost: Int
|
||||
var count: Int
|
||||
}
|
||||
|
||||
struct Upgrade: Codable {
|
||||
let name: String
|
||||
let description: String
|
||||
let cost: Int
|
||||
let appliesTo: String
|
||||
var isPurchased: Bool
|
||||
}
|
||||
|
||||
struct Achievement: Codable {
|
||||
let title: String
|
||||
let description: String
|
||||
}
|
||||
|
||||
struct SavedGame: Codable {
|
||||
let name: String
|
||||
let cookies: Int
|
||||
let cps: Int
|
||||
let items: [Item]
|
||||
let achievements: [Achievement]
|
||||
}
|
||||
10
CookieSwifter/CookieSwifter/CookieSwifter.entitlements
Normal file
10
CookieSwifter/CookieSwifter/CookieSwifter.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>
|
||||
21
CookieSwifter/CookieSwifter/CookieSwifterApp.swift
Normal file
21
CookieSwifter/CookieSwifter/CookieSwifterApp.swift
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// CookieSwifterApp.swift
|
||||
// CookieSwifter
|
||||
//
|
||||
// Created by Nihaal Sharma on 16/12/2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct CookieSwifterApp: App {
|
||||
let listOfNames = ["John", "Jane", "Alex", "Chris", "Taylor", "Morgan", "Emily", "Joshua", "Sophie", "Lucas", "Olivia", "Liam", "Isabella", "Ethan", "Amelia", "Aiden", "Mia", "James", "Charlotte", "Benjamin", "Ava", "Henry", "Ella", "Samuel", "Grace", "Daniel", "Zoe", "Matthew", "Madeline", "Ryan", "Chloe", "Michael", "Leah", "William", "Hannah", "David", "Scarlett", "Jack", "Victoria", "Noah", "Lily", "Gabriel", "Sophia", "Caleb", "Harper", "Mason", "Lillian", "Nathan", "Eleanor", "Jacob", "Ruby", "Isaac", "Harper", "Jackson", "Abigail", "Charlotte", "Oliver", "Ella", "Scarlett", "Henry", "Evelyn", "Elijah", "Aria", "Mason", "Amos", "Leo", "Luna", "Zachary", "Hazel", "Samuel", "Nora", "Owen", "Anna"]
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView(
|
||||
gameManager: CookieGame(),
|
||||
gameName: (listOfNames.randomElement() ?? "Bob") + "'s Bakery"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
16
CookieSwifter/CookieSwifterTests/CookieSwifterTests.swift
Normal file
16
CookieSwifter/CookieSwifterTests/CookieSwifterTests.swift
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// CookieSwifterTests.swift
|
||||
// CookieSwifterTests
|
||||
//
|
||||
// Created by Nihaal Sharma on 16/12/2024.
|
||||
//
|
||||
|
||||
import Testing
|
||||
|
||||
struct CookieSwifterTests {
|
||||
|
||||
@Test func example() async throws {
|
||||
// Write your test here and use APIs like `#expect(...)` to check expected conditions.
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// CookieSwifterUITests.swift
|
||||
// CookieSwifterUITests
|
||||
//
|
||||
// Created by Nihaal Sharma on 16/12/2024.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
final class CookieSwifterUITests: XCTestCase {
|
||||
|
||||
override func setUpWithError() throws {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
|
||||
// In UI tests it is usually best to stop immediately when a failure occurs.
|
||||
continueAfterFailure = false
|
||||
|
||||
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
|
||||
}
|
||||
|
||||
override func tearDownWithError() throws {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func testExample() throws {
|
||||
// UI tests must launch the application that they test.
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func testLaunchPerformance() throws {
|
||||
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
|
||||
// This measures how long it takes to launch your application.
|
||||
measure(metrics: [XCTApplicationLaunchMetric()]) {
|
||||
XCUIApplication().launch()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// CookieSwifterUITestsLaunchTests.swift
|
||||
// CookieSwifterUITests
|
||||
//
|
||||
// Created by Nihaal Sharma on 16/12/2024.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
final class CookieSwifterUITestsLaunchTests: XCTestCase {
|
||||
|
||||
override class var runsForEachTargetApplicationUIConfiguration: Bool {
|
||||
true
|
||||
}
|
||||
|
||||
override func setUpWithError() throws {
|
||||
continueAfterFailure = false
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func testLaunch() throws {
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
|
||||
// Insert steps here to perform after app launch but before taking a screenshot,
|
||||
// such as logging into a test account or navigating somewhere in the app
|
||||
|
||||
let attachment = XCTAttachment(screenshot: app.screenshot())
|
||||
attachment.name = "Launch Screen"
|
||||
attachment.lifetime = .keepAlways
|
||||
add(attachment)
|
||||
}
|
||||
}
|
||||
13
README.md
13
README.md
@@ -1 +1,14 @@
|
||||
# CookieSwifter
|
||||
|
||||
I recently stumbled upon a past favourite: (Cookie Clicker)[https://orteil.dashnet.org/cookieclicker/]
|
||||
|
||||
This gave me the idea to convert it to an iOS App
|
||||
|
||||
### Features
|
||||
- Save and Load Named Games
|
||||
- Custom Bakery names
|
||||
- Items
|
||||
- Achievements
|
||||
- Upgrades
|
||||
- *very* balanced gameplay (gonna have to fix that later lol)
|
||||
|
||||
|
||||
15
wak.toml
Normal file
15
wak.toml
Normal file
@@ -0,0 +1,15 @@
|
||||
# https://github.com/iamawatermelo/wakapi-anyide v0.6.8
|
||||
|
||||
[meta]
|
||||
version = 1
|
||||
watchers = ['files']
|
||||
|
||||
[files]
|
||||
include = ["*"] # files to include in tracking
|
||||
exclude = [] # files to exclude in tracking
|
||||
exclude_files = [] # files whose contents will be used to exclude other files from tracking
|
||||
exclude_binary_files = true # whether to ignore binary files
|
||||
# language_mapping = {".kicad_sch" = "Kicad Schematic"} # custom language mapping
|
||||
|
||||
[project]
|
||||
name = "CookieSwifter" # your project name
|
||||
Reference in New Issue
Block a user