1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | var Line = function(id, name, interval){ this.id = id; this.name = name; this.interval = interval; this.stops = []; this.buses = []; this.onSim = false; } this.reset = function(){ this.onSim = true; for (var i = 0; i < this.buses.length; i++) this.buses.reset(); } } |
1 2 3 4 5 6 7 8 9 10 11 12 | var Stop = function(id,name){ this.id = id; this.name = name; this.location = undefined; //in % this.passengers = []; /* Show people at stop */ this.showPeople = function(){ $("#stop_" + this.id + "_people") .html(this.passengers.length); } } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |