Skip to content

Instantly share code, notes, and snippets.

@grofit
grofit / traefik-compose.yml
Created May 23, 2020 19:32
Setting up Traefik 2 dashboard with basic auth, this is the same as my basic traefik 2 setup but with user auth from a file, you can see the original one here https://gist.github.com/grofit/e9a94ca02ba31ed1db9f88104f81c502
version: "3.7"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
ports:
- "80:80"
- "443:443"
- "8080:8080"
@grofit
grofit / Objective.cs
Last active June 25, 2023 11:31
Quick RPG Quest System Example
public class Objective
{
public ObjectiveType Type {get;set;}
public int ObjectiveInt {get;set;}
public float ObjectiveFloat {get;set;}
public Vector3 ObjectiveVector {get;set;}
// could possibly use Dictionary instead
}
@grofit
grofit / 1-summary.md
Last active June 13, 2022 08:44
Indie Gaming Advice Thread Backup

This is a backup of a post made MANY years ago over at Indie Gamer Forum at request of others I have put it here for others to read.

If you have any questions related to this I dont really check that forum so head on over to my open source projects discord and ping me there Discord, with that out of the way everything else here is a lift from the forum post, enjoy.

FREE tools to assist in getting indie projects started

I was looking through but could not find much listed on this topic so wanted to condense some lessons learnt over the years and some good (and free) tools that can be used for an individual or a team to get the best start on a project and to help keep everything moving along smoothly.

So you have come up with a great indie game idea and you have done more than the 99% and have decided to go from the "thinking" phase to the "doing" phase, now rather than rushing in to some im

@grofit
grofit / Account.cs
Created January 7, 2015 11:45
A GOOD Generic Repository Pattern
public class Account
{
Guid Id {get;set;}
string Name {get;set;}
}
@grofit
grofit / ExistingApproach.cs
Created June 12, 2015 12:52
A hybrid Strategy/Chain Of Responsibility style approach
public class Character
{
public EntityStates CurrentState { get; }
public void Update()
{
switch(CurrentState)
{
case EntityStates.Idle
{
@grofit
grofit / traefik-compose.yml
Last active June 2, 2020 13:47
Setting up traefik 2 dashboard manually - This was a huge time sink for me, I hope this helps you (see https://gist.github.com/grofit/34c68dfa836eb351815edede5fc71f2f for my one with basic auth)
version: "3.7"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
ports:
- "80:80"
- "443:443"
- "8080:8080" # could be any port you want 1234:8080
@grofit
grofit / NoCompositionOrSeparationItem.cs
Last active May 17, 2020 18:45
Example of view separation with composition
public class NoCompositionOrSeparationItem
{
public Sprite ItemImage;
public Vector3 InventoryPosition;
public Image ItemOverlay;
public string Name {get;set;}
public ItemType Type {get;set;}
public int Value {get;set;}
}
@grofit
grofit / NotUsingIoC.cs
Last active May 17, 2020 18:45
What is Inversion of Control
/*
This is worst case scenario
- You are unable to control the dependency or swap it for another without changing the NotUsingIoC source code.
- You are also going to have difficulties testing this as you cannot easily mock _someDependency.
*/
public class NotUsingIoC
{
private ISomeDependency _someDependency;
@grofit
grofit / CompositionExample.cs
Created May 31, 2015 08:58
An example of inheritance woes
/* Ok lets start by expressing the intent for a vehicle to move */
public interface IVehicleMovement
{
public float Speed {get; set;}
public void Move(Vector2 direction);
}
/* This will implement the most common form of movement */
public class SimpleWheelMovement : IVehicleMovement
{
@grofit
grofit / EntityBatchOperation.cs
Created April 24, 2020 21:33
Entity Operation Batching
public class EntityBatchOperation
{
private const int NoComponentTypeId = -1;
private Entity _entity;
private List<int> _componentsAdded = new List<int>();
private List<int> _componentsRemoved = new List<int>();
public EntityBatchOperation(Entity entity)
{