import System;
class UnlockEvent {
var year : int;
var month : int;
var day : int;
var hour : int;
var minute : int;
function UnlockEvent () {
var now = DateTime.Now;
year = now.Year;
month = now.Month;
day = now.Day;
hour = now.Hour;
minute = 0;
}
}
class UnlockEventComparer extends IComparer {
function Compare(a : Object, b : Object) {
var uea : UnlockEvent = a;
var ueb : UnlockEvent = b;
var dta : DateTime = new DateTime(uea.year, uea.month, uea.day, uea.hour. uea.minute, 0);
var dtb : DateTime = new DateTime(ueb.year, ueb.month, ueb.day, ueb.hour. ueb.minute, 0);
return dta.Compare(dtb);
}
}
Results in these errors:
Assets/Test.js(24) error BCE0019: ‘uea’ is not a member of ‘int’.
Assets/Test.js(25) error BCE0019: ‘ueb’ is not a member of ‘int’.
Those are the DateTime constructor lines.
This is the DateTime constructor I’m using:
(Forum won’t handle this link)
What’s going on? I guess I’ll just not use DateTime in this context for now and do the comparison myself.
Thanks,
-Jon