Skip to content

Instantly share code, notes, and snippets.

View PoignardAzur's full-sized avatar
💭
Sleep mode off

Olivier FAURE PoignardAzur

💭
Sleep mode off
  • Paris, France
View GitHub Profile
@PoignardAzur
PoignardAzur / DIP-unique_pointers.md
Last active September 29, 2019 08:22
Draft for a DIP to add unique pointers

DIP - Unique pointers

Rationale

The use case for unique semantics is pretty common:

struct SmartPtr {
@PoignardAzur
PoignardAzur / CodelessCodeBestOf.txt
Last active October 18, 2019 11:58
Interesting pages from the Codeless Code
22 - Wrappers
35 - API
39 - Naming
60 - Security
73+74 - Logs
91 - Brevity
98 - Anti-patterns teaching
100 - 10.000 mistakes
104 - Guard rails
109 - Generic solutions
@PoignardAzur
PoignardAzur / StealthSystem.md
Created October 18, 2019 12:21
Ideas for a stealth system

Inspired by the board game "Scotland Yard".

The player is invisible, but leaves clues/breadcrumbs that let NPCs guess its path.

The IA can follow simple patterns (eg straigt lines, the player disappearing next to a ventilation duct) to anticipate the player and lay ambushes.

@PoignardAzur
PoignardAzur / FightingSystem.md
Last active October 18, 2019 12:47
Ideas for a fighting system

Critical hits

Two types of hits: normal and critical.

Every weapon has a "edge", a different way of making crits. (see also Dead Cells)

Edges are related to mechanics of the combat system, eg:

  • Parrying,
  • Backstabs,
  • Dodging,
@PoignardAzur
PoignardAzur / EcsArchitectureNotes.md
Created October 18, 2019 12:54
Notes on ECS architecture

See Pocket

The main semantic interest (beside performance benefits) is the ability to write

if (entity.hasComponent!Foobar)
  entity.component!(Foobar).doThing(...);

Also, apply a system only to entities with the relevant components (example?)

Start the Separatist playthrough in an Obviously Doomed Hometown.

Have really trivial tutorial quests, while dropping hints that the village is about to be attacked by the Empire. At the end, the Empire attacks, but is quickly repelled. The game plays on the player's expectation that the village will be destroyed for drama points.

@PoignardAzur
PoignardAzur / AnimorphsFicIdea.md
Created June 20, 2020 17:46
Animorphs fic Idea
@PoignardAzur
PoignardAzur / DynSafeMcp.md
Last active July 8, 2020 12:42
MCP - Expand object safety

Proposal

NOTE: There has been some debate in the past as to what term best describes when a trait can be turned into a trait object with the syntax dyn MyTrait. The current official term is "object safety", but it is widely agreed to be unsatisfying. We use "dyn-safety" in this document.

Summary

  • Progressively move the language towards having by-default dyn-safety for all traits.

  • To that end, add a new ?dyn trait qualifier to indicate that template parameters accept a trait object.

I poured myself a cup of tea, floated down my books from upstairs, and sat down across from him.

There was no burst of energy or determination in my veins. I felt as frightened and unfocused and tired as I did an hour ago. And I wanted more than anything to get drunk, or play Jao Lu, or listen to the radio or watch something on one of those fancy new television sets.

I sat down at the coffee table, next to Hira. And I flipped open the book.

https://pithserial.com/2020/06/30/7-a-the-blue-charlatan/

pub trait VirtualDom {
fn update_value(&mut self, other: Self);
#[track_caller]
fn init_tree(&self, cx: &mut Cx);
fn apply_diff(&self, other: &Self, cx: &mut Cx) -> bool;
}