Skip to content

Commit 502ab02

Browse files
committed
Add Dir.random
1 parent 3f33fc3 commit 502ab02

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/rails_lib/backend/constants.ml

+2
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,5 @@ let reference_year = 1740
6767

6868
let build_industry_mult = 40
6969

70+
let chance_destroy_resource = 9 (* 1 in 9 *)
71+

src/rails_lib/utils/dir.ml

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ type t =
1313

1414
let dirlist = [Up; UpRight; Right; DownRight; Down; DownLeft; Left; UpLeft]
1515
let dirlist_left = [Left; UpLeft; Up; UpRight; Right; DownRight; Down; DownLeft]
16+
let dir_array = Array.of_list dirlist
17+
18+
let random r = Random.pick_array dir_array r
1619

1720
module Infix = struct
1821
let (<) x y = compare x y < 0

todo.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Tasks
2+
- Deal with region-based, duplicate tile to pixel mapping
3+
- Check default state of development_map and block_map
24
- Make sure money gets deducted for new engine
35
- Also for new train
46
- Also for station, upgrade etc

0 commit comments

Comments
 (0)