Skip to content

Instantly share code, notes, and snippets.

static void clearPiece( const int sq, position* pos ) {
ASSERT(sqOnBoard(sq));
int piece = pos->pieces[sq];
ASSERT(pieceValid(piece));
int colour = pieceColours[piece];
HASH_PIECE(piece, sq);
int t_pieceNum = -1;
#pragma once
#include <string>
#include <iostream>
#include <bitset>
#include <SDL/SDL.h>
#include "Position.h"
#include "Debug.h"
#include "Button.h"
Button::Button() {
}
Button::~Button() {
}
#pragma once
#include <algorithm>
#include <functional>
#include <set>
template<typename T>
using rw = std::reference_wrapper<T>;
template<typename T>
using crw = const std::reference_wrapper<T>;
private bool InventoryContains(Item i){
return inventory.FindIndex(item => item.id == i.id) >= 0;
}
@Folling
Folling / card
Created February 11, 2018 21:29
using System.Collections;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace Assets.Scripts.Cards {
[RequireComponent(typeof(RectTransform), typeof(Image))]
public class Card : MonoBehaviour,
IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler,
IBeginDragHandler, IDragHandler, IEndDragHandler {

New Features

  • Sorting anything lexicographically is implemented
  • A new text-editor, currently supporting:
    • bold, italic, underlined, and strikethrough text
    • coloured text
    • different fonts
    • different font-sizes
    • headers 1, 3, and 6
    • bulleted and numbered lists
  • A very basic menu-bar allowing you to save projects in different locations, and return to the project-picker
@Folling
Folling / imgui_slider.cpp
Last active November 16, 2025 12:07
an incomplete ImGui::Slider wrapper with support for scrolling to change the underlying value, includes support for glm::vec's and can be easily extended
template<typename F, typename T>
concept ImGuiSliderFunc = requires(
F f, std::string_view label, T * v, value_or_ref_t<T> v_min, value_or_ref_t<T> v_max, char const * format, ImGuiSliderFlags flags
) {
{ f(label.data(), v, v_min, v_max, format, flags) } -> std::convertible_to<bool>;
};
template<typename T>
struct delayed_false : std::false_type {};