UNPKG
@tdurtschi/bug
Version:
latest (1.0.10)
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
Bug is a simulation that models a weevil walking around in an HTML canvas.
@tdurtschi/bug
/
dist
/
src
/
core
/
entities
/
plant
/
plantFactory.d.ts
11 lines
(10 loc)
•
311 B
TypeScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
Plant
, {
PlantState
}
from
"./plant"
;
export
default
class
PlantFactory
{
private
generateId;
private
width;
private
plantPosCursor;
constructor
(
generateId
: () =>
number
,
width
:
number
);
build
(
initialState
?:
Partial
<
PlantState
>):
Plant
;
private
getNextPos;
private
randomX; }