Skip to content

Commit

Permalink
changed Trains module to use on_train_created event Afforess#84
Browse files Browse the repository at this point in the history
Currently this is breaking backwards compatibility
  • Loading branch information
Choumiko committed May 26, 2017
1 parent 53cdf78 commit 0eff3f3
Show file tree
Hide file tree
Showing 3 changed files with 218 additions and 212 deletions.
19 changes: 15 additions & 4 deletions spec/trains/fixtures.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@ Train_Spec_Fixtures = {
type = 'locomotive',
unit_number = 1000,
train = {
id = 1001,
valid = true,
state = 1,
locomotives = {
front_movers = {
[1] = { unit_number = 1000 }
},
back_movers = nil
},
carriages = {
[1] = { unit_number = 1000 }
}
}
}
},

Single_Train_With_Two_Locomotives = function()
train = {
local train = {
id = 1001,
valid = true,
state = 1,
locomotives = {
Expand All @@ -31,14 +36,14 @@ Train_Spec_Fixtures = {
}
}

loco_1 = {
local loco_1 = {
name = 'diesel-locomotive',
type = 'locomotive',
unit_number = 1000,
train = train
}

loco_2 = {
local loco_2 = {
name = 'diesel-locomotive',
type = 'locomotive',
unit_number = 2000,
Expand All @@ -57,6 +62,7 @@ Train_Spec_Fixtures = {
type = 'locomotive',
unit_number = 1000,
train = {
id = 1001,
valid = true,
state = 1,
locomotives = {
Expand All @@ -73,6 +79,7 @@ Train_Spec_Fixtures = {
type = 'locomotive',
unit_number = 2000,
train = {
id = 2001,
valid = true,
state = 1,
locomotives = {
Expand All @@ -86,11 +93,12 @@ Train_Spec_Fixtures = {
},

Trains_In_Different_States = {
[1] = {
[1] = {
name = 'diesel-locomotive',
type = 'locomotive',
unit_number = 1000,
train = {
id = 1001,
valid = true,
state = 1,
locomotives = {
Expand All @@ -107,6 +115,7 @@ Train_Spec_Fixtures = {
type = 'locomotive',
unit_number = 2000,
train = {
id = 2001,
valid = true,
state = 9,
locomotives = {
Expand All @@ -121,6 +130,7 @@ Train_Spec_Fixtures = {

Train_With_Front_And_Back_Locomotives_A = function()
train = {
id = 1001,
valid = true,
state = 1,
locomotives = {
Expand Down Expand Up @@ -155,6 +165,7 @@ Train_Spec_Fixtures = {

Train_With_Front_And_Back_Locomotives_B = function()
train = {
id = 2001,
valid = true,
state = 1,
locomotives = {
Expand Down
Loading

1 comment on commit 0eff3f3

@Choumiko
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i totally didn't want to push this. This is completely untested in a mod.

Please sign in to comment.