예제 #1
0
        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);
        }
예제 #2
0
        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));
        }
    }
예제 #4
0
파일: App.cs 프로젝트: uvbs/codestrikebot
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
파일: Main.cs 프로젝트: uvbs/codestrikebot
        private void Main_Load(object sender, EventArgs e)
        {
            picScreen1.Image = new Bitmap(394, 702);

            Database = new BotDatabase();
        }
예제 #7
0
    [SerializeField] List <GamePlayer> playerList     = new List <GamePlayer>();    //手牌

    void Awake()
    {
        instance    = this;
        botDatabase = Resources.Load <BotDatabase>("BotDatabase");
    }
예제 #8
0
 public void Delete()
 {
     BotDatabase.DeleteObject(this);
 }
예제 #9
0
        public static Settings GetSettings()
        {
            List <DataObject> objects = BotDatabase.GetObjects <Settings>();

            return((Settings)(objects[0]));
        }
예제 #10
0
 public Settings Save()
 {
     return((Settings)BotDatabase.SaveObject(this));
 }
예제 #11
0
 public Account Save()
 {
     return((Account)BotDatabase.SaveObject(this));
 }
예제 #12
0
 public ScheduleTask Save()
 {
     return((ScheduleTask)BotDatabase.SaveObject(this));
 }
예제 #13
0
 public EmulatorInstance Save()
 {
     return((EmulatorInstance)BotDatabase.SaveObject(this));
 }
예제 #14
0
파일: App.cs 프로젝트: uvbs/codestrikebot
 public App Save()
 {
     return((App)BotDatabase.SaveObject(this));
 }