Skip to content

Instantly share code, notes, and snippets.

/*
Realistic Water Shader for Godot 3.4
Modified to work with Godot 3.4 with thanks to jmarceno.
Copyright (c) 2019 UnionBytes, Achim Menzel (alias AiYori)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, W
/*
Realistic Water Shader for Godot 3.4
Modified to work with Godot 3.4 with thanks to jmarceno.
Copyright (c) 2019 UnionBytes, Achim Menzel (alias AiYori)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, W
@JohnLambe
JohnLambe / ID.cs
Created September 19, 2016 22:56
Struct for ID (see the XML comment at the top).
using System;
namespace JohnLambe.Util.Types
{
/// <summary>
/// Generic type for an ID (a value used to identify something).
/// <para>Since it is an ID, most operations of the underlying type are not supported:
/// One generally shouldn't manipulate it; it is just assigned and compared.</para>
/// <para>It can be cast explicitly to its underlying type in order to assign a value
/// to a new instance and read the value for external storage or transmission.
@JohnLambe
JohnLambe / FixedPoint.cs
Last active July 19, 2016 07:09
A class for a 64-bit fixed point (4 decimal places) decimal number type. UNFINISHED. This is free to use, without attribution, including for commercial use.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// unfinished
namespace JohnLambe.Util.Math
{
@JohnLambe
JohnLambe / Date.cs
Last active July 12, 2016 20:26
Classes to represent a date (day, month and year only) and time of day. In C# 6, for .NET Framework 4.5. Incomplete unit tests are included (the last three files - with names ending with "Test"). Version 0.1.6.4 (Beta).
using System;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.Serialization;
namespace JohnLambe.Util.TimeUtilities
{
/// <summary>
/// An immutable date with no time part.
/// <para>This has members equivalent to (most of) the members of <see cref="DateTime"/> relevant to the Date part.</para>
@JohnLambe
JohnLambe / AutoFactory.cs
Last active July 12, 2016 20:28
AutoFactory - automatic generation of simple factories. See https://jblambe.wordpress.com/2016/04/03/auto-factories/ . This does not include the code for integration with a DI container (I wrote an adaptor for Unity, and unit tests, to be released shortly). (C) Copyright 2016 John Lambe. Version 0.1.6.3 (Beta).
using System;
namespace JohnLambe.Util.DependencyInjection.AutoFactory
{
// Classes that implement each of the IFactory&lt;TInterface,...&gt; interfaces:
// No arguments to `Create`:
public class AutoFactory<TInterface> : AutoFactoryBase<TInterface>, IFactory<TInterface>
where TInterface : class
{