mirror of
https://github.com/BlackMATov/evolved.lua.git
synced 2025-12-13 03:29:08 +07:00
move example to samples/systems
This commit is contained in:
5
.luacov
Normal file
5
.luacov
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
modules = {
|
||||||
|
['evolved'] = 'evolved.lua'
|
||||||
|
}
|
||||||
|
reporter = 'html'
|
||||||
|
reportfile = 'luacov.report.html'
|
||||||
@@ -96,7 +96,7 @@ luarocks install evolved.lua
|
|||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
To get started with `evolved.lua`, read the [Overview](#overview) section to understand the basic concepts and how to use the library. After that, check the [Example](develop/example.lua), which demonstrates complex usage of the library. Finally, refer to the [Cheat Sheet](#cheat-sheet) for a quick reference of all the functions and classes provided by the library.
|
To get started with `evolved.lua`, read the [Overview](#overview) section to understand the basic concepts and how to use the library. After that, check the [Samples](develop/samples), which demonstrate complex usage of the library. Finally, refer to the [Cheat Sheet](#cheat-sheet) for a quick reference of all the functions and classes provided by the library.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
require 'develop.example'
|
|
||||||
require 'develop.untests'
|
|
||||||
|
|
||||||
require 'develop.samples.relations'
|
require 'develop.samples.relations'
|
||||||
|
require 'develop.samples.systems'
|
||||||
|
|
||||||
require 'develop.testing.name_tests'
|
require 'develop.testing.name_tests'
|
||||||
require 'develop.testing.pairs_tests'
|
require 'develop.testing.pairs_tests'
|
||||||
require 'develop.testing.requires_fragment_tests'
|
require 'develop.testing.requires_fragment_tests'
|
||||||
require 'develop.testing.system_as_query_tests'
|
require 'develop.testing.system_as_query_tests'
|
||||||
|
|
||||||
|
require 'develop.untests'
|
||||||
|
|
||||||
require 'develop.unbench'
|
require 'develop.unbench'
|
||||||
require 'develop.usbench'
|
require 'develop.usbench'
|
||||||
|
|
||||||
|
|||||||
@@ -5,17 +5,32 @@ local evo = require 'evolved'
|
|||||||
evo.debug_mode(true)
|
evo.debug_mode(true)
|
||||||
|
|
||||||
local fragments = {
|
local fragments = {
|
||||||
planet = evo.builder():name('planet'):tag():spawn(),
|
planet = evo.builder()
|
||||||
spaceship = evo.builder():name('spaceship'):tag():spawn(),
|
:name('planet')
|
||||||
|
:tag()
|
||||||
|
:spawn(),
|
||||||
|
spaceship = evo.builder()
|
||||||
|
:name('spaceship')
|
||||||
|
:tag()
|
||||||
|
:spawn(),
|
||||||
}
|
}
|
||||||
|
|
||||||
local relations = {
|
local relations = {
|
||||||
docked_to = evo.builder():name('docked_to'):tag():explicit():spawn(),
|
docked_to = evo.builder()
|
||||||
|
:name('docked_to')
|
||||||
|
:tag()
|
||||||
|
:spawn(),
|
||||||
}
|
}
|
||||||
|
|
||||||
local planets = {
|
local planets = {
|
||||||
mars = evo.builder():name('Mars'):set(fragments.planet):spawn(),
|
mars = evo.builder()
|
||||||
venus = evo.builder():name('Venus'):set(fragments.planet):spawn(),
|
:name('Mars')
|
||||||
|
:set(fragments.planet)
|
||||||
|
:spawn(),
|
||||||
|
venus = evo.builder()
|
||||||
|
:name('Venus')
|
||||||
|
:set(fragments.planet)
|
||||||
|
:spawn(),
|
||||||
}
|
}
|
||||||
|
|
||||||
local spaceships = {
|
local spaceships = {
|
||||||
|
|||||||
@@ -1441,3 +1441,6 @@ do
|
|||||||
assert(evo.has(e, evo.pair(p, s)) and evo.get(e, evo.pair(p, s)) == nil)
|
assert(evo.has(e, evo.pair(p, s)) and evo.get(e, evo.pair(p, s)) == nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- TODO
|
||||||
|
-- builder:has/has_all/has_any should work with wildcards / remove too?
|
||||||
|
|||||||
Reference in New Issue
Block a user