Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
andreakarasho authored Mar 5, 2024
1 parent 5757af6 commit 1e44928
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,39 @@ foreach (var archetype in world.Filter<(With<Position>, With<Velocity>, Not<Npc>
}
```

# Plugins

Relationships
```csharp
// Spawn the container
var woodenChest = ecs.Entity()
.Set<Container>();

var sword = ecs.Entity()
.Set<Weapon>()
.Set<Damage>(new () { Min = 5, Max = 15 });
.Set<Amount>(new () { Value = 1 });
var goldCoins = ecs.Entity()
.Set<Gold>()
.Set<Amount>(new () { Value = 245 })
var silverCoins = ecs.Entity()
.Set<Silver>()
.Set<Amount>(new () { Value = 874 })

// Add contents to the woodenChest
woodenChest.AddChild(sword);
woodenChest.AddChild(goldCoins);
woodenChest.AddChild(silverCoins);
```

Unique entities
```csharp
// create or get an entity named 'Khun'
var dog = ecs.Entity("Khun");
dog.Set<Bau>(); 🐶
```


# Credits

Base code idea inspired by:
Expand Down

0 comments on commit 1e44928

Please sign in to comment.