コード例 #1
0
 public FNTReserved(BinaryReader reader, uint size)
 {
     for (int i = 0; i < size; i++)
     {
         Reserved.Add(reader.ReadInt32());
     }
 }
コード例 #2
0
ファイル: Stockpile.cs プロジェクト: htmlcoderexe/ColonyGame
        public List <Interfaces.ITask> GenerateTasks()
        {
            List <Interfaces.ITask> result = new List <Interfaces.ITask>();

            Point v;

            List <MapItem> items = ParentMap.GetObjects <MapItem>();

            foreach (MapItem Item in items)
            {
                if (!Item.Reserved && ParentMap.FindStockpile(Item) == null)
                {
                    v = GetFreeSpot();
                    if (v == new Point(-1, -1))
                    {
                        return(result);
                    }
                    Components.Tasks.Haul h = new Tasks.Haul(Item, v);
                    Item.Reserved = true;
                    Reserved.Add(v);
                    result.Add(h);
                }
            }

            return(result);
        }
コード例 #3
0
        private async void Browser_OnReserved(object sender, ReservedEventArgs e)
        {
            ReserverWebView browser = sender as ReserverWebView;

            FileService.SaveData(ORDERS_FILE_PATH, Orders);

            await Notifier.NotifyMessage(
                $"(FROM {Profile.Login}) {e.Order?.Surname} {e.Order?.Name}: {e.Url}",
                FixChatId(LogChatId.Text)
                );

            Reserved.Add(new ReservedInfo(e.Url));
            Log($"Link {e.Order?.Surname} {e.Order?.Name}: {e.Url}", browser.RealBrowserNumber);

            PutOrderToBrowser(browser);
            HandleBusyChange();
        }
コード例 #4
0
        private async void Browser_OnReservedManually(object sender, ReservedEventArgs e)
        {
            ReserverWebView view = sender as ReserverWebView;

            string path   = Path.Combine(SCREENS_FOLDER_PATH, $"{e.Url.Replace(URL_TO_SCREEN_FILENAME_TRASH_PREFIX, "")}.png");
            Bitmap screen = await Reservers[view.RealBrowserNumber].GetCapture();
            bool   saved  = screen != null && screen.TrySave(path);

            if (saved)
            {
                await Notifier.NotifyPhoto(path, $"(FROM {Profile.Login}) {e.Url}", FixChatId(LogChatId.Text));
            }
            else
            {
                await Notifier.NotifyMessage($"(FROM {Profile.Login}) {e.Url}", FixChatId(LogChatId.Text));
            }

            Reserved.Add(new ReservedInfo(e.Url));
            FileService.SaveData(OUTPUT_FILE_PATH, Reserved);

            Log($"Link: {e.Url}", view.RealBrowserNumber);
            HandleBusyChange();
        }