Ejemplo n.º 1
0
 protected override void Activate(Drip drip, PlayerController player)
 {
     Place(player.transform.position, Vector2.up);
     Place(player.transform.position, Vector2.right);
     Place(player.transform.position, Vector2.down);
     Place(player.transform.position, Vector2.left);
 }
Ejemplo n.º 2
0
        public ActionResult DeleteConfirmed(long id)
        {
            Drip drip = db.Drips.Find(id);

            db.Drips.Remove(drip);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
    protected override void Activate(Drip drip, PlayerController player)
    {
        Decay decay = Instantiate(shield_, player.transform.position, Util.LookAt(Camera.main.ScreenToWorldPoint(Input.mousePosition) - player.transform.position))
                      .AddComponent <Decay>();

        decay.decay_               = 0.1f;
        decay.renderer_            = decay.GetComponentInChildren <SpriteRenderer>();
        decay.transform.localScale = Vector3.one * 2;
    }
Ejemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "IrrigationUnitId,Name,IrrigationType,IrrigationEfficiency,Surface,Width,Length")] Drip drip)
 {
     if (ModelState.IsValid)
     {
         db.Entry(drip).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(drip));
 }
Ejemplo n.º 5
0
        public ActionResult Create([Bind(Include = "IrrigationUnitId,Name,IrrigationType,IrrigationEfficiency,Surface,Width,Length")] Drip drip)
        {
            if (ModelState.IsValid)
            {
                db.Drips.Add(drip);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(drip));
        }
Ejemplo n.º 6
0
        public async Task AddDrip(CommandContext ctx, string imgURL, [RemainingText] string name)
        {
            var interactivity = ctx.Client.GetInteractivity();

            using (SqliteContext lite = new SqliteContext())
            {
                var dripEmbed = new DiscordEmbedBuilder
                {
                    Title       = ":fire:" + name + " DRIP :fire:",
                    Description = $"Are you sure this what you want? (You cannot remove it once you confirm)",
                    ImageUrl    = imgURL,
                    Color       = DiscordColor.Black
                };

                await ctx.Channel.SendMessageAsync(embed : dripEmbed);

                await ctx.Channel.SendMessageAsync($"**{ctx.Member.DisplayName}**, respond with \"y\" to confirm.");

                var confirmation = await interactivity.WaitForMessageAsync(x => x.Channel == ctx.Channel &&
                                                                           x.Author.Id == ctx.Member.Id);

                if (confirmation.Result.Content.ToString() != "y")
                {
                    await ctx.Channel.SendMessageAsync("`request cancelled.`");

                    return;
                }

                using (DripContext drip = new DripContext())
                {
                    var  list    = drip.Drip.ToListAsync().Result;
                    Drip newDrip = new Drip
                    {
                        Title    = name,
                        ImageURL = imgURL,
                    };
                    foreach (var item in list)
                    {
                        if (item.Title == name)
                        {
                            await ctx.Channel.SendMessageAsync("Drip Already Exists.");

                            return;
                        }
                    }

                    await ctx.Channel.SendMessageAsync("`success!`");

                    drip.Drip.Add(newDrip);
                    await drip.SaveChangesAsync();
                }
            }
        }
Ejemplo n.º 7
0
    public void Use(Drip drip, PlayerController player)
    {
        if (!(WaveSpawner.waveCounter_ >= stageActive_ &&
              currentCooldown_ + cooldown_ <= Time.time))
        {
            return;
        }

        Sound.Instance.Play(player.transform.position, Resources.Load <AudioClip>("Skill"));

        currentCooldown_ = Time.time;
        Activate(drip, player);
    }
Ejemplo n.º 8
0
        // GET: Drips/Delete/5
        public ActionResult Delete(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Drip drip = db.Drips.Find(id);

            if (drip == null)
            {
                return(HttpNotFound());
            }
            return(View(drip));
        }
Ejemplo n.º 9
0
        public void AddDrip(DripDTO dripDto)
        {
            Drip drip = new Drip
            {
                Name     = dripDto.Name,
                Company  = dripDto.Company,
                Diameter = dripDto.Diameter,
                Brand    = dripDto.Brand,
                Racks    = dripDto.Racks,
                Contry   = dripDto.Contry,
                Price    = dripDto.Price,
            };

            Database.Drips.Create(drip);
            Database.Save();
        }
Ejemplo n.º 10
0
        public void Add(ImageDripDTO imageDripDto)
        {
            Drip drip = Database.Drips.Get(imageDripDto.DripId);

            // валидация
            if (drip == null)
            {
                throw new ValidationException("Drip не найден", "");
            }
            ImageDrip imageDrip = new ImageDrip
            {
                Data     = imageDripDto.Data,
                MimeType = imageDripDto.MimeType,
                DripID   = drip.Id,
            };

            Database.ImageDrips.Create(imageDrip);
            Database.Save();
        }
Ejemplo n.º 11
0
        public void MakeOrderDrip(OrderDTO orderDto)
        {
            Drip drip = Database.Drips.Get(orderDto.DripId);

            // валидация
            if (drip == null)
            {
                throw new ValidationException("Drip не найден", "");
            }
            decimal sum   = drip.Price;
            Order   order = new Order
            {
                Date        = DateTime.Now,
                Address     = orderDto.Address,
                DripId      = drip.Id,
                Sum         = sum,
                PhoneNumber = orderDto.PhoneNumber
            };

            Database.Orders.Create(order);
            Database.Save();
        }
Ejemplo n.º 12
0
 protected abstract void Activate(Drip drip, PlayerController player);
Ejemplo n.º 13
0
 protected override void Activate(Drip drip, PlayerController player)
 {
     player.transform.position = drip.transform.position;
 }
Ejemplo n.º 14
0
 public DripViewModel(Drip pDrip)
 {
     this.IrrigationUnitId = pDrip.IrrigationUnitId;
     this.Width            = pDrip.Width;
     this.Length           = pDrip.Length;
 }