public static List <ScheduleTask> GetTasks(List <Account> accounts, List <App> apps) { List <DataObject> objects = BotDatabase.GetObjects <ScheduleTask>(); List <ScheduleTask> tasks = new List <ScheduleTask>(); foreach (DataObject o in objects) { ScheduleTask task = (ScheduleTask)o; if (task.NextAction <= DateTime.Now) { foreach (Account a in accounts) { if (a.Id == task.Account.Id) { task.Account = a; } } foreach (App a in apps) { if (a.Id == task.App.Id) { task.App = a; } } tasks.Add(task); } } tasks.Sort(); return(tasks); }
public static List <EmulatorInstance> GetEmulators(List <Account> accounts, List <App> apps) { List <DataObject> objects = BotDatabase.GetObjects <EmulatorInstance>(); List <EmulatorInstance> emulators = new List <EmulatorInstance>(); foreach (DataObject o in objects) { EmulatorInstance emulator = (EmulatorInstance)o; foreach (Account a in accounts) { if (a.Id == emulator.LastKnownAccount.Id) { emulator.LastKnownAccount = a; } } foreach (App a in apps) { if (a.Id == emulator.App.Id) { emulator.App = a; } } emulators.Add(emulator); } return(emulators); }
void Awake() { botDatabase = Resources.Load <BotDatabase>("BotDatabase"); for (int i = 0; i < toggles.Count; i++) { int id = i; toggles[i].onValueChanged.AddListener((bool value) => OnToggleClick(id, value)); } }
public static List <App> GetApps() { List <DataObject> objects = BotDatabase.GetObjects <App>(); List <App> apps = new List <App>(); foreach (DataObject o in objects) { apps.Add((App)o); } return(apps); }
public static List <Account> GetAccounts(List <App> apps) { List <DataObject> objects = BotDatabase.GetObjects <Account>(); List <Account> accounts = new List <Account>(); foreach (DataObject o in objects) { Account account = (Account)o; foreach (App a in apps) { if (a.Id == account.App.Id) { account.App = a; } } accounts.Add(account); } return(accounts); }
private void Main_Load(object sender, EventArgs e) { picScreen1.Image = new Bitmap(394, 702); Database = new BotDatabase(); }
[SerializeField] List <GamePlayer> playerList = new List <GamePlayer>(); //手牌 void Awake() { instance = this; botDatabase = Resources.Load <BotDatabase>("BotDatabase"); }
public void Delete() { BotDatabase.DeleteObject(this); }
public static Settings GetSettings() { List <DataObject> objects = BotDatabase.GetObjects <Settings>(); return((Settings)(objects[0])); }
public Settings Save() { return((Settings)BotDatabase.SaveObject(this)); }
public Account Save() { return((Account)BotDatabase.SaveObject(this)); }
public ScheduleTask Save() { return((ScheduleTask)BotDatabase.SaveObject(this)); }
public EmulatorInstance Save() { return((EmulatorInstance)BotDatabase.SaveObject(this)); }
public App Save() { return((App)BotDatabase.SaveObject(this)); }