Пример #1
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// </param>
 /// <param name='count'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> ModifyMagazineProductAsync(this IMagazine operations, int id, int count, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ModifyMagazineProductWithHttpMessagesAsync(id, count, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #2
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <MagazineEntry> > GetAllProductsAsync(this IMagazine operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetAllProductsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #3
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> RemoveAllMagazineProductsAsync(this IMagazine operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.RemoveAllMagazineProductsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #4
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='name'>
 /// </param>
 /// <param name='count'>
 /// </param>
 /// <param name='localization'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> AddMagazineProductAsync(this IMagazine operations, string name, int count, string localization, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.AddMagazineProductWithHttpMessagesAsync(name, count, localization, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #5
0
 public void RegisterMaterialWithinMagazine(IMagazine mag, MaterialQuantity quantity)
 {
     if (!magazineList.Any(f => f.MagazineName == mag.MagazineName))
     {
         magazineList.Add(mag);
         mag.AddMaterialToStock(quantity);
     }
     else
     {
         var magazine = FindMagazine(mag.MagazineName);
         magazine.AddMaterialToStock(quantity);
     }
 }
Пример #6
0
 public void Info(IMagazine magazine)
 {
     Console.WriteLine("\n" + magazine.Name);
     Console.Write("Work status:");
     magazine.Working();
     if (Doxod < 0)
     {
         Console.WriteLine("Rasxod:" + Doxod);
     }
     else
     {
         Console.WriteLine("Doxod:" + Doxod);
     }
     Console.WriteLine("Rasxod without doxod:-" + magazine.Rasxod);
 }
        void Awake()
        {
            // Create a layer mask for the Shootable layer.
            shootableMask   = LayerMask.GetMask("Shootable");
            magazineFactory = MagazineFactory.Instance;

            currentMag = magazineFactory.GetMagazine();
            // Set up the references.
            gunParticles = GetComponent <ParticleSystem>();
            gunLine      = GetComponent <LineRenderer>();
            gunAudio     = GetComponent <AudioSource>();
            gunLight     = GetComponent <Light>();

            gunAudio.clip = gunShot;

            //faceLight = GetComponentInChildren<Light> ();
        }
Пример #8
0
 public new void ProcessRecipe(IMagazine magazine)
 {
     _logger.Debug(_moduleName, string.Format("{0}.ProcessRecipe({1})", typeof(PolishLinePlc).Name, magazine.ToString()));
     base.ProcessRecipe(magazine);
 }
Пример #9
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='name'>
 /// </param>
 /// <param name='count'>
 /// </param>
 /// <param name='localization'>
 /// </param>
 public static object AddMagazineProduct(this IMagazine operations, string name, int count, string localization)
 {
     return(Task.Factory.StartNew(s => ((IMagazine)s).AddMagazineProductAsync(name, count, localization), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Пример #10
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// </param>
 public static object GetProduct(this IMagazine operations, int id)
 {
     return(Task.Factory.StartNew(s => ((IMagazine)s).GetProductAsync(id), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Пример #11
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IList <MagazineEntry> GetAllProducts(this IMagazine operations)
 {
     return(Task.Factory.StartNew(s => ((IMagazine)s).GetAllProductsAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Пример #12
0
 public void ProcessRecipe(IMagazine magazine)
 {
     WriteMemory<ProcessRecipeToStreamConverter, IMagazine>(haProcessRecipe, magazine);
 }
Пример #13
0
 public void Raschet(IMagazine magazine)
 {
     Doxod     = magazine.viruchka - magazine.Rasxod;
     AllMoney += Doxod;
 }
Пример #14
0
 private string GetWriteCommandProcessRecipeString(IMagazine magazine)
 {
     return (new PlcMemoryWriteCommand(PlcHelper.GetAddressSpace(), 0x122, new ProcessRecipeToStreamConverter().TryConvert(magazine))).CommandToString();
 }