コード例 #1
0
 public AbilityHitPointEvent(Vector3 point, OldContext context)
 {
     this.point   = point;
     this.context = context;
     ability      = context.ability;
     caster       = ability.caster;
 }
コード例 #2
0
 public AbilityHitEntityEvent(Entity target, OldContext context)
 {
     this.target  = target;
     this.context = context;
     ability      = context.ability;
     caster       = ability.caster;
 }
コード例 #3
0
        public override void Synchronize(Func <ProductionScheduleKey> getInput)
        {
            var productionScheduleKey = getInput();

            var productionSchedule = UnitOfWork.ProductionScheduleRepository.FindByKey(productionScheduleKey,
                                                                                       p => p.ScheduledItems.Select(i => i.PackSchedule.ProductionBatches));

            var    location = UnitOfWork.LocationRepository.FindByKey(productionScheduleKey.ToLocationKey());
            string street;
            int    row;

            LocationDescriptionHelper.GetStreetRow(location.Description, out street, out row);

            var oldProductionSchedule = OldContext.tblProductionSchedules
                                        .Include(p => p.tblProductionScheduleGroups.Select(g => g.tblProductionScheduleItems))
                                        .FirstOrDefault(p => p.ProductionDate == productionScheduleKey.ProductionScheduleKey_ProductionDate && (int)p.LineNumber == row);

            if (productionSchedule == null)
            {
                if (oldProductionSchedule != null)
                {
                    DeleteSchedule(oldProductionSchedule);
                }
            }
            else
            {
                SetSchedule(oldProductionSchedule, productionSchedule, row);
            }

            OldContext.SaveChanges();

            Console.WriteLine(ConsoleOutput.SyncProductionSchedule, productionScheduleKey.ProductionScheduleKey_ProductionDate.ToString("yyyyMMdd"), row);
        }
コード例 #4
0
        public override void Synchronize(Func <SalesOrderKey> getInput)
        {
            if (getInput == null)
            {
                throw new ArgumentNullException("getInput");
            }

            var orderKey = getInput();
            var order    = UnitOfWork.SalesOrderRepository.FindByKey(orderKey, o => o.InventoryShipmentOrder);
            var tblOrder = OldContext.tblOrders
                           .FirstOrDefault(o => o.OrderNum == order.InventoryShipmentOrder.MoveNum);

            if (tblOrder == null)
            {
                throw new Exception(string.Format("Could not find tblOrder[{0}]", order.InventoryShipmentOrder.MoveNum));
            }

            tblOrder.Status       = (int?)tblOrderStatus.Invoiced;
            tblOrder.InvoiceDate  = order.InvoiceDate;
            tblOrder.InvoiceNotes = order.InvoiceNotes;

            OldContext.SaveChanges();

            Console.WriteLine(ConsoleOutput.InvoicedOrder, tblOrder.OrderNum);
        }
コード例 #5
0
        public override void Synchronize(Func <IntraWarehouseOrderKey> getInput)
        {
            if (getInput == null)
            {
                throw new ArgumentNullException("getInput");
            }

            var orderKey = getInput();
            var order    = UnitOfWork.IntraWarehouseOrderRepository.FindByKey(orderKey,
                                                                              o => o.PickedInventory.Items.Select(i => i.PackagingProduct.Product),
                                                                              o => o.PickedInventory.Items.Select(i => i.FromLocation),
                                                                              o => o.PickedInventory.Items.Select(i => i.CurrentLocation));

            if (order == null)
            {
                throw new Exception(string.Format("IntraWarehouseOrder[{0}] not found in new context.", orderKey));
            }

            bool createdNew;
            var  oldOrder = Synchronize(order, out createdNew);

            if (createdNew)
            {
                UnitOfWork.Commit();
            }
            OldContext.SaveChanges();

            Console.Write(ConsoleOutput.SynchronizedIntraWarehouserMovement, oldOrder.RinconID.ToString(DateTimeFormat));
        }
コード例 #6
0
ファイル: CastQueue.cs プロジェクト: weichx/AbilitySystem
        public Ability UpdateCast() {

            if (queuedExpire.ReadyWithReset(0.2f)) {
                queuedAbility = null;
            }

            if (currentAbility == null || !gcdTimer.Ready) return null;

            CastState castState = currentAbility.UpdateCast();

            if (castState == CastState.Invalid) {
                Clear();
            }
            else if (castState == CastState.Completed) {

                if (currentAbility.IsInstant && !currentAbility.IgnoreGCD) {
                    gcdTimer.Reset(GetGlobalCooldownTime(currentAbility));
                }

                currentAbility = queuedAbility;
                currentContext = queuedContext;
                queuedAbility = null;
                queuedContext = null;

                if (currentAbility != null && !currentAbility.Use(currentContext)) {
                    currentAbility = null;
                    currentContext = null;
                }

            }

            return currentAbility;

        }
コード例 #7
0
        public override void Synchronize(Func <LotKey> getInput)
        {
            if (getInput == null)
            {
                throw new ArgumentNullException("getInput");
            }
            var lotKey = getInput();

            var oldLot    = new SyncLotHelper(OldContext, UnitOfWork, OldContextHelper).SynchronizeOldLot(lotKey, false, false);
            var inventory = UnitOfWork.InventoryRepository
                            .Filter(i => i.LotDateCreated == lotKey.LotKey_DateCreated && i.LotDateSequence == lotKey.LotKey_DateSequence && i.LotTypeId == lotKey.LotKey_LotTypeId,
                                    i => i.PackagingProduct.Product,
                                    i => i.Location,
                                    i => i.Treatment)
                            .ToList();

            foreach (var item in inventory)
            {
                OldContext.tblIncomings.AddObject(CreateIncoming(oldLot, item));
            }

            OldContext.SaveChanges();

            Console.Write(ConsoleOutput.ReceivedInventory, oldLot.Lot);
        }
コード例 #8
0
        protected override IEnumerable <AdditiveProduct> BirthRecords()
        {
            _loadCount.Reset();

            var productId = _newContext.NextIdentity <Product>(p => p.Id);

            foreach (var additiveProduct in OldContext.CreateObjectSet <tblProduct>().ToList().Where(p => p.PTypeID == (int)LotTypeEnum.Additive && p.ProdGrpID != 11 && p.ProdGrpID != 7))
            {
                _loadCount.AddRead(EntityTypes.AdditiveProduct);
                _loadCount.AddRead(EntityTypes.Product);
                _loadCount.AddLoaded(EntityTypes.AdditiveProduct);
                _loadCount.AddLoaded(EntityTypes.Product);

                yield return(new AdditiveProduct
                {
                    Id = productId,
                    Product = new Product
                    {
                        Id = productId,
                        ProductType = ProductTypeEnum.Additive,
                        IsActive = additiveProduct.InActive == false,
                        Name = additiveProduct.Product,
                        ProductCode = additiveProduct.ProdID.ToString(CultureInfo.InvariantCulture)
                    },
                    AdditiveTypeId = additiveProduct.IngrID ?? AdditiveTypeMother.Unknown.Id
                });

                productId += 1;
            }

            _loadCount.LogResults(l => Log(new CallbackParameters(l)));
        }
コード例 #9
0
 public void Clear()
 {
     currentAbility = null;
     currentContext = null;
     queuedAbility  = null;
     queuedContext  = null;
 }
コード例 #10
0
        public override void Synchronize(Func <NotebookKey> getInput)
        {
            if (getInput == null)
            {
                throw new ArgumentNullException("getInput");
            }

            var notebookKey = getInput();
            var notebook    = UnitOfWork.NotebookRepository.FindByKey(notebookKey, n => n.Notes);

            if (notebook == null)
            {
                throw new Exception(string.Format("Notebook[{0}] not found.", notebookKey));
            }

            var productionBatch = UnitOfWork.ProductionBatchRepository.Filter(b => b.InstructionNotebookDateCreated == notebook.Date && b.InstructionNotebookSequence == notebook.Sequence).FirstOrDefault();

            if (productionBatch != null)
            {
                var lotNumber = LotNumberBuilder.BuildLotNumber(productionBatch);
                new SyncTblBatchInstr(OldContext).Synchronize(notebook, lotNumber);
                OldContext.SaveChanges();

                Console.WriteLine(ConsoleOutput.UpdatedBatchInstructions, lotNumber);
                return;
            }

            var contract = UnitOfWork.ContractRepository.GetContractForSynch(notebookKey);

            if (contract != null)
            {
                new SyncContract(UnitOfWork).Synchronize(contract, false);
            }
        }
コード例 #11
0
        protected override IEnumerable <PackagingProduct> BirthRecords()
        {
            _loadCount.Reset();

            var productId = _newContext.NextIdentity <Product>(p => p.Id);

            foreach (var package in OldContext.CreateObjectSet <tblPackaging>().ToList())
            {
                _loadCount.AddRead(EntityTypes.PackagingProduct);
                _loadCount.AddRead(EntityTypes.Product);
                _loadCount.AddLoaded(EntityTypes.PackagingProduct);
                _loadCount.AddLoaded(EntityTypes.Product);

                yield return(new PackagingProduct
                {
                    Id = productId,
                    Product = new Product
                    {
                        Id = productId,
                        ProductType = ProductTypeEnum.Packaging,
                        IsActive = package.InActive == false,
                        Name = package.Packaging,
                        ProductCode = package.PkgID.ToString(CultureInfo.InvariantCulture),
                    },
                    Weight = (double)(package.NetWgt ?? 0),
                    PackagingWeight = (double)(package.PkgWgt ?? 0),
                    PalletWeight = (double)(package.PalletWgt ?? 0)
                });

                productId += 1;
            }

            _loadCount.LogResults(l => Log(new CallbackParameters(l)));
        }
コード例 #12
0
        public override void Synchronize(Func <int?> getInput)
        {
            if (getInput == null)
            {
                throw new ArgumentNullException("getInput");
            }

            var orderNum = getInput();
            var order    = OldContext.tblOrders
                           .Include(o => o.tblOrderDetails.Select(d => d.tblStagedFGs))
                           .FirstOrDefault(o => o.OrderNum == orderNum);

            if (order == null)
            {
                throw new Exception(string.Format("Could not find customer order with key[{0}].", orderNum));
            }

            foreach (var detail in order.tblOrderDetails.ToList())
            {
                foreach (var staged in detail.tblStagedFGs.ToList())
                {
                    OldContext.tblStagedFGs.DeleteObject(staged);
                }

                OldContext.tblOrderDetails.DeleteObject(detail);
            }

            OldContext.tblOrders.DeleteObject(order);

            OldContext.SaveChanges();

            Console.WriteLine(ConsoleOutput.RemovedTblOrder, orderNum);
        }
コード例 #13
0
        public static void Sync(INetworker networker)
        {
            // For now, allowing both sides to push. This behaviour needs to be replaced in general anyways
            if (networker.Hosting || true)
            {
                var save = Scene.Current.FindComponent <GamePieces>()?.GetSave();

                if (!save.HasValue || save.Value.Res == null)
                {
                    Logs.Game.WriteWarning("Attempted to sync, but no gave save found.");
                    OldContext.ShowNotification("Error", "Failed to start sync.", 3);
                }
                else
                {
                    SendSave(networker, save.Value.Res);
                    OldContext.ShowNotification("Info", "Sync started.", 3);
                }
            }

            else if (networker.Connected)
            {
                networker.SendData(CommandChannel, "Sync");
                OldContext.ShowNotification("Info", "Sync requested.", 3);
            }

            else
            {
                Logs.Game.WriteWarning($"Cannot try to sync while {networker.Status.ToString().ToLower()}");
            }
        }
コード例 #14
0
        public override void Synchronize(Func <SynchronizeCustomerProductSpecs> getInput)
        {
            if (getInput == null)
            {
                throw new ArgumentNullException("getInput");
            }

            var    parameters = getInput();
            int    prodID;
            string company_IA;

            if (parameters.Delete != null)
            {
                Delete(parameters.Delete, out prodID, out company_IA);
            }
            else if (parameters.ChileProductKey != null && parameters.CustomerKey != null)
            {
                Serialize(parameters.ChileProductKey, parameters.CustomerKey, out prodID, out company_IA);
            }
            else
            {
                return;
            }

            OldContext.SaveChanges();

            Console.WriteLine(ConsoleOutput.UpdatedCustomerSpecs, company_IA, prodID);
        }
コード例 #15
0
        public override void Synchronize(Func<SyncSampleOrderParameters> getInput)
        {
            if(getInput == null) { throw new ArgumentNullException("getInput"); }

            var parameters = getInput();

            lock(Lock)
            {
                string message;
                var commitNewContext = false;
                if(parameters.DeleteSampleID != null)
                {
                    DeleteSampleOrder(parameters.DeleteSampleID.Value);
                    message = string.Format(ConsoleOutput.DeletedTblSample, parameters.DeleteSampleID);
                }
                else if(parameters.SampleOrderKey != null)
                {
                    var tblSample = Sync(parameters.SampleOrderKey, out commitNewContext);
                    message = string.Format(ConsoleOutput.SynchedTblSample, tblSample.SampleID);
                }
                else
                {
                    return;
                }

                OldContext.SaveChanges();
                if(commitNewContext)
                {
                    UnitOfWork.Commit();
                }

                Console.WriteLine(message);
            }
        }
コード例 #16
0
ファイル: Resource.cs プロジェクト: weichx/AbilitySystem
 public void Decrease(float amount, OldContext context) {
     float adjustedValue = 0;
     for (int i = 0; i < adjusters.Count; i++) {
         adjustedValue -= adjusters[i].Adjust(amount, this, context);
     }
     currentValue -= adjustedValue;
 }
コード例 #17
0
        private List <tblRinconDTO> SelectRinconRecordsToLoad()
        {
            return(OldContext.CreateObjectSet <tblRincon>()
                   .Where(r => r.Updated != null)
                   .Select(r => new tblRinconDTO
            {
                EmployeeID = r.EmployeeID,
                RinconID = r.RinconID,
                MoveDate = r.MoveDate,
                SheetNum = r.SheetNum,
                PrepBy = r.PrepBy,

                tblRinconDetails = r.tblRinconDetails.Select(d => new tblRinconDetailDTO
                {
                    RDetailID = d.RDetailID,
                    EmployeeID = d.EmployeeID,
                    RinconID = d.RinconID,
                    Lot = d.Lot,
                    PTypeID = d.tblLot.PTypeID,
                    PkgID = d.PkgID,
                    TrtmtID = d.TrtmtID,
                    Quantity = d.Quantity,
                    CurrLocID = d.CurrLocID,
                    DestLocID = d.DestLocID
                })
            })
                   .ToList());
        }
コード例 #18
0
        public sealed override void Synchronize(Func <LotKey> getInput)
        {
            if (getInput == null)
            {
                throw new ArgumentNullException("getInput");
            }
            var key        = getInput();
            var production = UnitOfWork.ChileLotProductionRepository.FindByKey(key,
                                                                               m => m.ResultingChileLot.ChileProduct.Product,
                                                                               m => m.Results.ProductionLineLocation,
                                                                               m => m.Results.ResultItems.Select(i => i.PackagingProduct.Product),
                                                                               m => m.Results.ResultItems.Select(i => i.Location),
                                                                               m => m.PickedInventory.Items.Select(i => i.PackagingProduct.Product),
                                                                               m => m.PickedInventory.Items.Select(i => i.FromLocation),
                                                                               m => m.PickedInventory.Items.Select(i => i.Treatment));

            bool newLot;
            var  tblLot = GetOrCreateLot(production, out newLot);

            SetIncomingRecords(tblLot, production.Results.ResultItems);
            SetOutgoingRecords(tblLot, production);

            OldContext.SaveChanges();
            Console.Write(newLot ? ConsoleOutput.AddedLot : ConsoleOutput.UpdatedLot, tblLot.Lot);
        }
コード例 #19
0
        public static void OnGameStart()
        {
            SceneSelector selector = null;

            foreach (var scene in ContentProvider.GetAvailableContent <Scene>())
            {
                selector = scene.Res?.FindComponent <SceneSelector>() ?? selector;
            }

            if (selector == null)
            {
                Logs.Game.WriteWarning("Unable to set scenes, SceneSelector not found.");
            }
            else
            {
                _gameScene = selector.Game;
                _menuScene = selector.Menu;


                if (_gameScene.Res == null || _menuScene.Res == null)
                {
                    Logs.Game.WriteWarning("Scene Selector ContentRefs aren't available, unable to set scenes.");
                }
            }

            OldContext.ClearNotifications();
        }
コード例 #20
0
        private static void Networker_Disconnected(object sender, ClientDisconnectedEventArgs e)
        {
            string reason = e.Reason;

            if (string.IsNullOrWhiteSpace(reason))
            {
                reason = ". No reason given.";
            }
            else
            {
                reason = ": " + reason;
            }

            if (CupboardApp.Networker.Hosting)
            {
                OldContext.ShowNotification("Info", e.RemoteEndPoint + " left the server.", duration: 3);
            }
            else
            {
                string type = reason == "Quit" ? "Info" : "Error";

                OldContext.ShowNotification(type, "Disconnected from server" + reason, duration: 3, channel: "Main");
                Scene.SwitchTo(_menuScene);
            }
        }
コード例 #21
0
        public override void Synchronize(Func <InventoryAdjustmentKey> getInput)
        {
            if (getInput == null)
            {
                throw new ArgumentNullException("getInput");
            }
            var key = getInput();
            var inventoryAdjustment = UnitOfWork.InventoryAdjustmentRepository.FindByKey(key,
                                                                                         a => a.Notebook.Notes,
                                                                                         a => a.Items.Select(i => i.PackagingProduct.Product),
                                                                                         a => a.Items.Select(i => i.Location),
                                                                                         a => a.Items.Select(i => i.Treatment),
                                                                                         a => a.Items.Select(i => i.Lot.PackagingLot.PackagingProduct.Product));

            var adjustId      = inventoryAdjustment.TimeStamp.ConvertUTCToLocal().RoundMillisecondsForSQL();
            var newAdjustment = new tblAdjust
            {
                AdjustID   = adjustId,
                EmployeeID = inventoryAdjustment.EmployeeId,
                Reason     = inventoryAdjustment.Notebook.Notes.Select(n => n.Text).FirstOrDefault()
            };

            AddOutgoingRecords(newAdjustment, inventoryAdjustment.Items);

            OldContext.tblAdjusts.AddObject(newAdjustment);
            OldContext.SaveChanges();
            Console.WriteLine(ConsoleOutput.AddedAdjust, newAdjustment.AdjustID.ToString(DateTimeExtensions.SQLDateTimeFormat));
        }
コード例 #22
0
        public override void Synchronize(Func <List <Contract> > getInput)
        {
            if (getInput == null)
            {
                throw new ArgumentNullException("getInput");
            }

            var contracts = getInput();

            if (contracts.Any())
            {
                foreach (var contract in contracts)
                {
                    var oldContract = OldContext.tblContracts.FirstOrDefault(c => c.ContractID == contract.ContractId);
                    if (oldContract == null)
                    {
                        throw new Exception(string.Format("Could not find tblContract[{0}] referenced by Contract[{1}]", contract.ContractId, new ContractKey(contract)));
                    }
                    oldContract.KStatus = ContractStatus.Completed.ToString();
                }

                OldContext.SaveChanges();

                Console.WriteLine(ConsoleOutput.CompletedExpiredContracts, contracts.Count);
            }
            else
            {
                Console.WriteLine(ConsoleOutput.NoExpiredContracts);
            }
        }
コード例 #23
0
        private IEnumerable <TransactionDTO> GetOutgoing()
        {
            return(OldContext.CreateObjectSet <tblOutgoing>()
                   .OrderByDescending(o => o.EntryDate)
                   .Where(o => CutoffDate == null || o.EntryDate > CutoffDate)
                   .Select(o => new TransactionDTO
            {
                EmployeeID = o.EmployeeID,
                EntryDate = o.EntryDate,
                TTypeID = o.TTypeID,

                Lot = o.Lot,
                PkgID = o.PkgID,
                LocID = o.LocID,
                TrtmtID = o.TrtmtID,
                Tote = o.Tote,
                Quantity = -o.Quantity,
                NewLot = o.NewLot,

                OutgoingID = o.ID,
                RinconID = o.RinconID,
                MoveNum = o.MoveNum,
                OrderNum = o.OrderNum,
                AdjustID = o.AdjustID,
                PackSchId = o.PackSchID
            }));
        }
コード例 #24
0
    public StatusEffect AddStatusEffect(string effectId, OldContext context)
    {
        Entity       caster   = context.entity;
        StatusEffect existing = statusList.Find((StatusEffect s) => {
            return(s.Id == effectId && s.caster == caster || s.IsUnique);
        });

        if (existing != null && existing.IsRefreshable)
        {
            existing.Refresh(context);
            return(existing);
        }

        StatusEffect statusEffect = EntitySystemLoader.Instance.Create <StatusEffect>(effectId);

        if (existing != null)
        {
            existing.Remove();
            statusList.Remove(existing);
        }

        statusEffect.Apply(entity, context);
        statusList.Add(statusEffect);

        return(statusEffect);
    }
コード例 #25
0
ファイル: Ability.cs プロジェクト: toros11/AbilitySystem
    public bool Use(OldContext context)
    {
        if (!Usable(context))
        {
            return(false);
        }

        this.context    = context;
        context.ability = this;

        SetComponentContext(context);
        OnUse();

        if (castState == CastState.Invalid)
        {
            if (castMode == CastMode.Channel)
            {
                float actualChannelTime = channelTime.Value;
                castTimer.Reset(actualChannelTime);
                channelTimer.Reset(actualChannelTime / channelTicks.Value);
            }
            else
            {
                float actualCastTime = castTime.Value;
                castTimer.Reset(actualCastTime);
                actualCastMode = (actualCastTime <= 0f) ? CastMode.Instant : castMode;
            }

            castState = CastState.Casting;
            OnCastStarted();
        }

        return(true);
    }
コード例 #26
0
        public override void Synchronize(Func <SyncSalesOrderParameters> getInput)
        {
            lock (_lock)
            {
                if (getInput == null)
                {
                    throw new ArgumentNullException("getInput");
                }

                var parameters = getInput();
                var key        = parameters.SalesOrderKey;
                var salesOrder = GetSalesOrder(key);
                if (salesOrder == null)
                {
                    throw new Exception(string.Format("Could not find SalesOrder with key[{0}].", key));
                }

                _commitNewContext = false;
                var oldOrder = GetOldOrder(salesOrder, parameters.New);
                oldOrder.SetSalesOrder(salesOrder);
                SyncOrderItems(salesOrder, oldOrder);

                if (_commitNewContext)
                {
                    UnitOfWork.Commit();
                }
                OldContext.SaveChanges();

                Console.WriteLine(ConsoleOutput.SyncTblOrder, salesOrder.InventoryShipmentOrder.MoveNum);
            }
        }
コード例 #27
0
        public override void Synchronize(Func <int?> getInput)
        {
            if (getInput == null)
            {
                throw new ArgumentNullException("getInput");
            }

            var contractId = getInput();

            if (contractId == null)
            {
                return;
            }

            var contract = OldContext.tblContracts.Include("tblContractDetails").FirstOrDefault(c => c.ContractID == contractId.Value);

            foreach (var detail in contract.tblContractDetails.ToList())
            {
                OldContext.tblContractDetails.DeleteObject(detail);
            }
            OldContext.tblContracts.DeleteObject(contract);
            OldContext.SaveChanges();

            Console.Write(ConsoleOutput.RemovedContract, contractId);
        }
コード例 #28
0
        public override void Synchronize(Func <PackScheduleKey> getInput)
        {
            if (getInput == null)
            {
                throw new ArgumentNullException("getInput");
            }
            var packScheduleKey = getInput();

            var newPackSchedule = UnitOfWork.PackScheduleRepository.SelectPackScheduleForSynch(packScheduleKey);
            var oldPackSchedule = OldContext.tblPackSches.Select(p => new
            {
                packSchedule = p,
                lots         = p.tblLots
            }).FirstOrDefault(p => p.packSchedule.PackSchID == newPackSchedule.PackSchID);

            if (oldPackSchedule == null)
            {
                throw new Exception(string.Format("Could not find tblPackSch[{0}] record.", newPackSchedule.PackSchID));
            }
            SynchronizePackScheduleHelper.SynchronizeOldContextPackSchedule(oldPackSchedule.packSchedule, newPackSchedule);

            OldContext.SaveChanges();

            Console.Write(ConsoleOutput.UpdatedPackSchedule, oldPackSchedule.packSchedule.PackSchID.ToPackSchIdString());
        }
コード例 #29
0
    //this is pseudo private
    public void AddStatusEffectFromTemplate(StatusEffectTemplate template)
    {
        StatusEffect effect  = template.Create(entity);
        OldContext   context = template.GetContext(entity);

        effect.Apply(entity, context);
        statusList.Add(effect);
    }
コード例 #30
0
        public override void Synchronize(Func <LotKey> getInput)
        {
            var lotNumber = LotNumberBuilder.BuildLotNumber(getInput());

            new DeleteTblLotHelper(OldContext).DeleteLots(lotNumber);
            OldContext.SaveChanges();
            Console.WriteLine(ConsoleOutput.DeletedTblLot, lotNumber);
        }
コード例 #31
0
 ///-------------------------------------------------------------------------------------------------
 /// <summary>
 ///  When overridden in a derived class, creates a copy of the synchronization context.
 /// </summary>
 /// <returns>
 ///  A new <see cref="T:System.Threading.SynchronizationContext" /> object.
 /// </returns>
 ///-------------------------------------------------------------------------------------------------
 public override SynchronizationContext CreateCopy()
 {
     if (OldContext != null)
     {
         return(OldContext.CreateCopy());
     }
     return(base.CreateCopy());
 }
コード例 #32
0
 public override bool OnTest(OldContext context, RequirementType type) {
     Entity target = context.Get<Entity>("Target");
     Entity caster = context.Get<Entity>("Caster");
     if(target == null) {
         return true;
     }
     return Vector3.Angle(target.transform.position, caster.transform.forward) < maximumAngleDifference;
 }
コード例 #33
0
 public float GetDamage(OldContext context)
 {
     if (formula == null)
     {
         return(baseValue);
     }
     return(formula.Invoke(context, baseValue));
 }
コード例 #34
0
ファイル: Resource.cs プロジェクト: weichx/AbilitySystem
 public void Increase(float amount, OldContext context) {
     float adjustedValue = 0;
     for (int i = 0; i < adjusters.Count; i++) {
         adjustedValue += adjusters[i].Adjust(amount, this, context);
     }
     currentValue += adjustedValue;
     //currentValue = Mathf.Clamp(currentValue, float.MinValue, baseTotal);
 }
コード例 #35
0
 public void SetAbilityContext(OldContext context) {
     this.context = context;
     targetPoint = transform.position;
     Vector2 offset = UnityEngine.Random.insideUnitCircle * originXZOffsetRadius;
     originPoint = targetPoint + (Vector3.up * spawnHeight);
     originPoint.x += offset.x;
     originPoint.z += offset.y;
     transform.position = originPoint;
 }
コード例 #36
0
    public virtual OldContext GetContext(Entity target) {
        if (context == null) {
            context = new OldContext();
        }
        context["target"] = target;
        context.entity = EntityManager.ImplicitEntity;

        return context;
    }
コード例 #37
0
    public override bool OnTest(OldContext context, RequirementType type) {
        var target = context.Get<Entity>("Target");
        var caster = context.entity;

        if(target == null) {
            return false;
        }

        return target.transform.DistanceToSquared(caster.transform) <= range.Value;
    }
コード例 #38
0
 public override bool OnTest(OldContext context, RequirementType type) {
     var caster = context.entity;
     for (int i = 0; i < statuses.Length; i++) {
         if (statuses[i] == null) continue;
         if (caster.statusManager.HasStatus(statuses[i])) {
             return true;
         }
     }
     return false;
 }
コード例 #39
0
ファイル: CastQueue.cs プロジェクト: weichx/AbilitySystem
 public void Enqueue(Ability ability, OldContext context) {
     if (ability == null || context == null) return;
     if (currentAbility == null) {
         currentAbility = ability;
         currentContext = context;
         currentAbility.Use(context);
     }
     else {
         queuedAbility = ability;
         queuedContext = context;
     }
 }
コード例 #40
0
    public bool Test(OldContext context, RequirementType type) {
        if (supressed || (type & RequirementType) == 0) {
            return true;
        }

        bool requirementMet = OnTest(context, type);

        if (requirementMet) {
            OnPassed(context, type);
        }
        else {
            OnFailed(context, type);
        }
        return requirementMet;
    }
コード例 #41
0
    public StatusEffect AddStatusEffect(string effectId, OldContext context) {
        Entity caster = context.entity;
        StatusEffect existing = statusList.Find((StatusEffect s) => {
            return s.Id == effectId && s.caster == caster || s.IsUnique;
        });

        if (existing != null && existing.IsRefreshable) {
            existing.Refresh(context);
            return existing;
        }

        StatusEffect statusEffect = EntitySystemLoader.Instance.Create<StatusEffect>(effectId);

        if (existing != null) {
            existing.Remove();
            statusList.Remove(existing);
        }

        statusEffect.Apply(entity, context);
        statusList.Add(statusEffect);

        return statusEffect;
    }
コード例 #42
0
ファイル: CastQueue.cs プロジェクト: weichx/AbilitySystem
 public void Clear() {
     currentAbility = null;
     currentContext = null;
     queuedAbility = null;
     queuedContext = null;
 }
コード例 #43
0
ファイル: ArmorAdjuster.cs プロジェクト: weichx/AbilitySystem
 public override float Adjust(float delta, Resource resource, OldContext context) {
     float armor = context.Get<float>("armor");
     return delta - armor;
 }
コード例 #44
0
    public virtual void OnEffectRefreshed(OldContext context) {

    }
コード例 #45
0
    public void SetAbilityContext(OldContext context) {
        this.context = context;
        target = context.Get<Entity>("target");
		transform.position = Vector3.zero;//context.entity.CastPoint;
    }
コード例 #46
0
 public virtual void OnFailed(OldContext context, RequirementType type) { }
コード例 #47
0
    public bool Cast(string abilityId, OldContext context) {
        Ability ability = GetAbility(abilityId);
        if (ability == null) throw new AbilityNotFoundException(abilityId);

        if (ability.Usable(context)) {
            castQueue.Enqueue(ability, context);
            return true;
        }

        return false;
    }
コード例 #48
0
 public AbilityHitPointEvent(Vector3 point, OldContext context) {
     this.point = point;
     this.context = context;
     ability = context.ability;
     caster = ability.caster;
 }
コード例 #49
0
 public static float ShadowSlash(OldContext context, float baseValue) {
     return 11;
 }
コード例 #50
0
 public void SetContext(OldContext context) {
     this.context = context;
 }
コード例 #51
0
 public void Start() {
     context = new OldContext();
 }
コード例 #52
0
 public static float Slash(OldContext context, float baseValue) {
     return 10f;
 }
コード例 #53
0
 public virtual bool OnTest(OldContext context, RequirementType type) { return true; }
コード例 #54
0
 public float GetDamage(OldContext context) {
     if(formula == null) {
         return baseValue;
     }
     return formula.Invoke(context, baseValue);
 }
コード例 #55
0
ファイル: Resource.cs プロジェクト: weichx/AbilitySystem
 public void DecreaseNormalized(float amount, OldContext context) {
    // Decrease(Mathf.Clamp01(amount / baseTotal), context);
 }
コード例 #56
0
 public abstract float Adjust(float delta, Resource resource, OldContext context);
コード例 #57
0
 public AbilityHitEntityEvent(Entity target, OldContext context) {
     this.target = target;
     this.context = context;
     ability = context.ability;
     caster = ability.caster;
 }