Esempio n. 1
0
 private CargoOrderData GetOrderData(CargoConsoleAddOrderMessage args, int index)
 {
     return(new CargoOrderData(index, args.Requester, args.Reason, args.ProductId, args.Amount));
 }
Esempio n. 2
0
        private void OnAddOrderMessage(EntityUid uid, CargoOrderConsoleComponent component, CargoConsoleAddOrderMessage args)
        {
            if (args.Amount <= 0)
            {
                return;
            }

            var bank = GetBankAccount(component);

            if (bank == null)
            {
                return;
            }
            var orderDatabase = GetOrderDatabase(component);

            if (orderDatabase == null)
            {
                return;
            }

            var data = GetOrderData(args, GetNextIndex(orderDatabase));

            if (!TryAddOrder(orderDatabase, data))
            {
                PlayDenySound(uid, component);
                return;
            }
        }