Esempio n. 1
0
 public TransferCargoOrder(bool isLoadOrder, CargoDelta cargoDelta, ICargoTransferrer target)
 {
     Owner       = Empire.Current;
     IsLoadOrder = isLoadOrder;
     CargoDelta  = cargoDelta;
     Target      = target;
 }
Esempio n. 2
0
        public CargoTransferForm(ICargoTransferrer fromContainer, Sector targetSector)
        {
            InitializeComponent();

            try { this.Icon = new Icon(FrEee.WinForms.Properties.Resources.FrEeeIcon); }
            catch { }

            clFrom.CargoContainer = fromContainer;
            txtFromContainer.Text = fromContainer.Name;
            var ccs = new List <ICargoContainer>();

            ccs.Add(targetSector);
            foreach (var cc in targetSector.SpaceObjects.OfType <ICargoTransferrer>().Where(cc => cc != fromContainer && cc.Owner == Empire.Current).OrderBy(cc => cc.Name))
            {
                ccs.Add(cc);
            }
            foreach (var cc in ccs)
            {
                ddlToContainer.Items.Add(cc);
            }
            if (ccs.OfType <ISpaceObject>().Any())
            {
                ddlToContainer.SelectedItem = ccs.OfType <ISpaceObject>().Cast <ICargoContainer>().WithMax(cc => cc.CargoStorage).First();
            }
            else
            {
                ddlToContainer.SelectedItem = targetSector;
            }
            clLoad.CargoDelta = new CargoDelta();
            clDrop.CargoDelta = new CargoDelta();
        }