This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Flip_Reason cpm_edge_should_flip(Constrained_Path_Mesh const& cpm, Path_Mesh_Data const& mesh_data, Edge const& edge) | |
{ | |
Flip_Reason result; | |
// --- Check for exterior edge | |
if (edge_is_on_hull(edge)) | |
{ | |
result.should_flip = false; | |
result.no = Flip_Reason::No::EXTERIOR; | |
return result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define DefineFlagOps(ENUM, INT_TYPE) \ | |
constexpr ENUM operator|(ENUM lhs, ENUM rhs) { return (ENUM)((INT_TYPE)lhs | (INT_TYPE)rhs); } \ | |
constexpr ENUM & operator|=(ENUM & lhs, ENUM rhs) { lhs = lhs | rhs; return lhs; } \ | |
constexpr ENUM operator&(ENUM lhs, ENUM rhs) { return (ENUM)((INT_TYPE)lhs & (INT_TYPE)rhs); } \ | |
constexpr ENUM & operator&=(ENUM & lhs, ENUM rhs) { lhs = lhs & rhs; return lhs; } \ | |
bool constexpr IsFlagSet(ENUM flags, ENUM query) { return (flags & query) == query; } \ | |
bool constexpr IsAnyFlagSet(ENUM flags, ENUM query) { return (INT_TYPE)(flags & query) != 0; } \ | |
constexpr ENUM operator~(ENUM e) { return (ENUM)~(INT_TYPE)e; } \ | |
StaticAssert(sizeof(ENUM) == sizeof(INT_TYPE)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE - This file is auto-generated by hgen. DO NOT MODIFY! | |
// building_core.h | |
namespace Construction | |
{ | |
inline fix64 HpStart(fix64 hpMax); | |
inline fix64 DHpPerSecond(fix64 hpMax, fix64 constructionTime); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE - This file is auto-generated by hgen. DO NOT MODIFY! | |
// building.h | |
enum class BuildingId : u32; | |
enum class BuildingType : u32; | |
struct TrainingQueue; | |
struct BuildingPlacementGhost; | |
enum class ConstructionFlags : u8; | |
struct ConstructionState; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SecureTransactor | |
{ | |
public bool DoManySecureTransactions(string[] data) | |
{ | |
if (!SecurityCheck()) return false; | |
bool doCheck = false; // We already did the check, no need to repeat ourselves! | |
foreach(string datum in data) | |
{ | |
InternalDoSecureTranaction(data, doCheck); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SecureTransactor | |
{ | |
public bool DoManySecureTransactions(string[] data) | |
{ | |
if (!SecurityCheck()) return false; | |
bool doCheck = false; // We already did the check, no need to repeat ourselves! | |
foreach(string datum in data) | |
{ | |
DoSecureTranaction(data, doCheck); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <stdarg.h> | |
#define BeginInterface(ifaceName) struct ifaceName##ITable { | |
#define BeginListFn static constexpr int s_iLineFnBase = __LINE__; | |
#define AddFn(returnType, funcName, ...) typedef returnType ( *Pfn##funcName )(void* __VA_ARGS__ ); static constexpr int s_iFn##funcName = __LINE__ - 1 - s_iLineFnBase; | |
#define BeginListImpl static constexpr int s_iLineImplBase = __LINE__; static constexpr int s_cFn = s_iLineImplBase - s_iLineFnBase - 1; | |
#define AddImpl(structName) static constexpr int s_iImpl##structName = __LINE__ - 1 - s_iLineImplBase; | |
#define EndInterface(ifaceName) static constexpr int s_cImpl = __LINE__ - 1 - s_iLineImplBase;\ | |
static constexpr int s_cFnPtrs = s_cImpl * s_cFn;\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
www.youtube.com##.ytp-scroll-min.ytp-pause-overlay |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// |--- h ---| h = horizon | |
// /____ /____ x = current face (other face is prev face) | |
// \ |\ /| c = conflict | |
// \ x |<--/---\ | |
// h2c \ | / |---- c2h (twin of prev h2c) | |
// _\\| / | |
// C | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
fighterToWeight = {} | |
weightClasses = ["Atomweight", "Strawweight", "Flyweight", | |
"Bantamweight", "Featherweight", "Lightweight", | |
"Welterweight", "Middleweight", "Light Heavyweight", | |
"Heavyweight", "Super Heavyweight"] | |
# Set up info about weight classes | |
with open('fighters.csv') as table: |