Преглед на файлове

Making a basic starting skeleton

Sam Jaffe преди 7 години
родител
ревизия
af6675c212
променени са 5 файла, в които са добавени 383 реда и са изтрити 0 реда
  1. 319 0
      dice-roll.xcodeproj/project.pbxproj
  2. 15 0
      include/die.hpp
  3. 22 0
      include/random.h
  4. 9 0
      src/die.cxx
  5. 18 0
      src/main.cxx

+ 319 - 0
dice-roll.xcodeproj/project.pbxproj

@@ -0,0 +1,319 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 50;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		CDED6A2721B2F28A00AB91D0 /* main.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CDED6A2621B2F28A00AB91D0 /* main.cxx */; };
+		CDED6A3121B2F2DC00AB91D0 /* die.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CDED6A3021B2F2DC00AB91D0 /* die.cxx */; };
+		CDED6A6121B2F89900AB91D0 /* libshared_random_generator.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CDED6A6021B2F89900AB91D0 /* libshared_random_generator.dylib */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+		CDED6A2121B2F28A00AB91D0 /* CopyFiles */ = {
+			isa = PBXCopyFilesBuildPhase;
+			buildActionMask = 2147483647;
+			dstPath = /usr/share/man/man1/;
+			dstSubfolderSpec = 0;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 1;
+		};
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+		CDED6A2321B2F28A00AB91D0 /* dice-roll */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "dice-roll"; sourceTree = BUILT_PRODUCTS_DIR; };
+		CDED6A2621B2F28A00AB91D0 /* main.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cxx; sourceTree = "<group>"; };
+		CDED6A2F21B2F2DC00AB91D0 /* die.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = die.hpp; sourceTree = "<group>"; };
+		CDED6A3021B2F2DC00AB91D0 /* die.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = die.cxx; sourceTree = "<group>"; };
+		CDED6A5821B2F6E800AB91D0 /* random.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = random.h; sourceTree = "<group>"; };
+		CDED6A6021B2F89900AB91D0 /* libshared_random_generator.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; path = libshared_random_generator.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		CDED6A2021B2F28A00AB91D0 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				CDED6A6121B2F89900AB91D0 /* libshared_random_generator.dylib in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		CDED6A1A21B2F28A00AB91D0 = {
+			isa = PBXGroup;
+			children = (
+				CDED6A2E21B2F2C300AB91D0 /* include */,
+				CDED6A2D21B2F2B200AB91D0 /* test */,
+				CDED6A2521B2F28A00AB91D0 /* src */,
+				CDED6A2421B2F28A00AB91D0 /* Products */,
+				CDED6A5F21B2F89900AB91D0 /* Frameworks */,
+			);
+			sourceTree = "<group>";
+		};
+		CDED6A2421B2F28A00AB91D0 /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				CDED6A2321B2F28A00AB91D0 /* dice-roll */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		CDED6A2521B2F28A00AB91D0 /* src */ = {
+			isa = PBXGroup;
+			children = (
+				CDED6A2621B2F28A00AB91D0 /* main.cxx */,
+				CDED6A3021B2F2DC00AB91D0 /* die.cxx */,
+			);
+			path = src;
+			sourceTree = "<group>";
+		};
+		CDED6A2D21B2F2B200AB91D0 /* test */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = test;
+			sourceTree = "<group>";
+		};
+		CDED6A2E21B2F2C300AB91D0 /* include */ = {
+			isa = PBXGroup;
+			children = (
+				CDED6A2F21B2F2DC00AB91D0 /* die.hpp */,
+				CDED6A5821B2F6E800AB91D0 /* random.h */,
+			);
+			path = include;
+			sourceTree = "<group>";
+		};
+		CDED6A5F21B2F89900AB91D0 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				CDED6A6021B2F89900AB91D0 /* libshared_random_generator.dylib */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		CDED6A2221B2F28A00AB91D0 /* dice-roll */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = CDED6A2A21B2F28A00AB91D0 /* Build configuration list for PBXNativeTarget "dice-roll" */;
+			buildPhases = (
+				CDED6A1F21B2F28A00AB91D0 /* Sources */,
+				CDED6A2021B2F28A00AB91D0 /* Frameworks */,
+				CDED6A2121B2F28A00AB91D0 /* CopyFiles */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = "dice-roll";
+			productName = "dice-roll";
+			productReference = CDED6A2321B2F28A00AB91D0 /* dice-roll */;
+			productType = "com.apple.product-type.tool";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		CDED6A1B21B2F28A00AB91D0 /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				LastUpgradeCheck = 1010;
+				ORGANIZATIONNAME = "Sam Jaffe";
+				TargetAttributes = {
+					CDED6A2221B2F28A00AB91D0 = {
+						CreatedOnToolsVersion = 10.1;
+					};
+				};
+			};
+			buildConfigurationList = CDED6A1E21B2F28A00AB91D0 /* Build configuration list for PBXProject "dice-roll" */;
+			compatibilityVersion = "Xcode 9.3";
+			developmentRegion = en;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+			);
+			mainGroup = CDED6A1A21B2F28A00AB91D0;
+			productRefGroup = CDED6A2421B2F28A00AB91D0 /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				CDED6A2221B2F28A00AB91D0 /* dice-roll */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+		CDED6A1F21B2F28A00AB91D0 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				CDED6A3121B2F2DC00AB91D0 /* die.cxx in Sources */,
+				CDED6A2721B2F28A00AB91D0 /* main.cxx in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+		CDED6A2821B2F28A00AB91D0 /* 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_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_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;
+				HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/usr/local/include";
+				MACOSX_DEPLOYMENT_TARGET = 10.13;
+				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+				MTL_FAST_MATH = YES;
+				ONLY_ACTIVE_ARCH = YES;
+				SDKROOT = macosx;
+				USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/include/";
+			};
+			name = Debug;
+		};
+		CDED6A2921B2F28A00AB91D0 /* 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_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_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;
+				HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/usr/local/include";
+				MACOSX_DEPLOYMENT_TARGET = 10.13;
+				MTL_ENABLE_DEBUG_INFO = NO;
+				MTL_FAST_MATH = YES;
+				SDKROOT = macosx;
+				USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/include/";
+			};
+			name = Release;
+		};
+		CDED6A2B21B2F28A00AB91D0 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				CODE_SIGN_STYLE = Automatic;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Debug;
+		};
+		CDED6A2C21B2F28A00AB91D0 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				CODE_SIGN_STYLE = Automatic;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		CDED6A1E21B2F28A00AB91D0 /* Build configuration list for PBXProject "dice-roll" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				CDED6A2821B2F28A00AB91D0 /* Debug */,
+				CDED6A2921B2F28A00AB91D0 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		CDED6A2A21B2F28A00AB91D0 /* Build configuration list for PBXNativeTarget "dice-roll" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				CDED6A2B21B2F28A00AB91D0 /* Debug */,
+				CDED6A2C21B2F28A00AB91D0 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = CDED6A1B21B2F28A00AB91D0 /* Project object */;
+}

+ 15 - 0
include/die.hpp

@@ -0,0 +1,15 @@
+//
+//  die.hpp
+//  dice-roll
+//
+//  Created by Sam Jaffe on 12/1/18.
+//  Copyright © 2018 Sam Jaffe. All rights reserved.
+//
+
+#pragma once
+
+namespace dice {
+  struct random {
+    
+  };
+}

+ 22 - 0
include/random.h

@@ -0,0 +1,22 @@
+//
+//  random.h
+//  dice-roll
+//
+//  Created by Sam Jaffe on 12/1/18.
+//  Copyright © 2018 Sam Jaffe. All rights reserved.
+//
+
+#pragma once
+
+#include <shared_random_generator/random.h>
+
+namespace dice { namespace engine {
+  class random : private ::engine::random_number_generator {
+    using super = ::engine::random_number_generator;
+  public:
+    using super::random_number_generator;
+    unsigned int roll(unsigned int sides) const {
+      return super::exclusive(sides) + 1;
+    }
+  };
+}}

+ 9 - 0
src/die.cxx

@@ -0,0 +1,9 @@
+//
+//  die.cxx
+//  dice-roll
+//
+//  Created by Sam Jaffe on 12/1/18.
+//  Copyright © 2018 Sam Jaffe. All rights reserved.
+//
+
+#include "die.hpp"

+ 18 - 0
src/main.cxx

@@ -0,0 +1,18 @@
+//
+//  main.cpp
+//  dice-roll
+//
+//  Created by Sam Jaffe on 12/1/18.
+//  Copyright © 2018 Sam Jaffe. All rights reserved.
+//
+
+#include <iostream>
+
+#include "die.hpp"
+#include "random.h"
+
+int main(int argc, const char * argv[]) {
+  // insert code here...
+  std::cout << "Hello, World!\n";
+  return 0;
+}