コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,IceCubeName")] IceCube iceCube)
        {
            if (id != iceCube.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(iceCube);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!IceCubeExists(iceCube.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(iceCube));
        }
コード例 #2
0
ファイル: PlayerAttack.cs プロジェクト: NullSoldier/breakers
    private float lastStateTime; // the time the last state change happened

    public void Awake()
    {
        playerCtrl = GetComponent <PlayerController>();
        rigidBody  = GetComponent <Rigidbody>();
        lastCube   = getCubeUnder();
        attackKey  = KeyCode.Space;
    }
コード例 #3
0
 public void AddIceCubesToInventory(int numberOfIceCubes)
 {
     for (int i = 0; i < numberOfIceCubes; i++)
     {
         IceCube iceCube = new IceCube();
         iceCubes.Add(iceCube);
     }
 }
コード例 #4
0
    public override void Execute()
    {
        base.Execute();
        IceCube ic = (IceCube)Cube;

        ic.NextPosition = EndPosition;
        SlideTo(true);
        Cube.MoveTo(EndPosition);
    }
コード例 #5
0
 public void AddIceToInv(double totalIce, double iceTotal, Player player)
 {
     for (int i = 0; i < totalIce; i++)
     {
         IceCube icecube = new IceCube();
         player.inventory.iceCubes.Add(icecube);
     }
     //player.inventory.displayInventory();
 }
コード例 #6
0
        public double GetRecipeCost()
        {
            Lemon     tempLemon         = new Lemon();
            IceCube   tempIceCube       = new IceCube();
            SugarCube tempSugarCube     = new SugarCube();
            double    priceOfLemons     = ((recipe.amountOfLemons) * (tempLemon.itemPrice));
            double    priceOfSugarCubes = ((recipe.amountOfSugarCubes) * (tempSugarCube.itemPrice));
            double    priceOfIceCubes   = ((recipe.amountOfIceCubes) * (tempIceCube.itemPrice));

            return(priceOfLemons + priceOfSugarCubes + priceOfIceCubes);
        }
コード例 #7
0
        public async Task <IActionResult> Create([Bind("Id,IceCubeName")] IceCube iceCube)
        {
            if (ModelState.IsValid)
            {
                _context.Add(iceCube);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(iceCube));
        }
コード例 #8
0
ファイル: Player.cs プロジェクト: maxrevilo/ETP_Matus_Atack
 public Player(Game game,Motor_Colisiones Motor)
     : base(game, new Vector3(9000,0,0), 1.0f, 0, Personaje.MaxLife , true)
 {
     Colisiones = Motor;
     Colisiones.Update_P_R(3.0f);
     LastFire = new FireCube();
     LastIce = new IceCube();
     posAnt = posicion;
     Proyectiles = new List<Disparo>();
     oldMS = Mouse.GetState();
     sE = game.Content.Load<SoundEffect>("SonidoFX\\Fireball");
 }
コード例 #9
0
ファイル: PlayerAttack.cs プロジェクト: NullSoldier/breakers
    public void Update()
    {
        float timeSinceLast = Time.time - lastStateTime;

        IceCube cube = getCubeUnder();

        if (cube)
        {
            cube.GetComponent <Renderer>().material.color = Color.red;
            lastCube = cube;
        }

        if (state != lastState)
        {
            if (state == PlayerAttackState.SlammingUp)
            {
                rigidBody.velocity = Vector3.up * 5;
            }
            else if (state == PlayerAttackState.SlammingDown)
            {
                rigidBody.velocity = Vector3.down * 10;
            }

            lastState     = state;
            lastStateTime = Time.time;
        }
        else
        {
            if (state == PlayerAttackState.None)
            {
                if (playerCtrl.IsViveController && isTriggerDown())
                {
                    state = PlayerAttackState.SlammingUp;
                    rumbleControllers();
                }
                else if (!playerCtrl.IsViveController && Input.GetKey(attackKey))
                {
                    state = PlayerAttackState.SlammingUp;
                }
            }
            else if (state == PlayerAttackState.SlammingUp)
            {
                if (timeSinceLast > 0.25)
                {
                    state = PlayerAttackState.SlammingDown;
                }
            }
        }
    }
コード例 #10
0
    public bool SlideTo(bool first)
    {
        Vector3Int next = new Vector3Int(EndPosition.x + Direction.x, EndPosition.y + Direction.y, EndPosition.z + Direction.z);

        if (CubeHelper.IsFree(next) && Cube.transform.position + Direction.ToVector3 + Vector3.up != EndPosition.ToVector3)
        {
            Level.Singleton.notifySwitches(EndPosition);
        }
        if (EndPosition.y == new Vector3Int(Cube.transform.position).y + 1)
        {
            return(true);
        }

        if (!finished && CubeHelper.IsFree(next) && next.x <= 10 && next.x >= 0 && next.z <= 10 && next.z >= 0)
        {
            EndPosition = next;
            return(SlideTo(false));
        }
        else if (next.x > 10 || next.x < 0 || next.z > 10 || next.z < 0)
        {
            //Cube.FallOutOfBounds(next.ToVector3);
            EndPosition = next;
            return(true);
        }
        if (Level.Singleton.getEntity(next.ToVector3) is RockCube)
        {
            IceCube ic = (IceCube)Cube;
            ic.Break();
            return(true);
        }
        while (CubeHelper.IsFree(new Vector3Int(EndPosition.ToVector3 + Vector3.down)) && EndPosition.y > 1)
        {
            Level.Singleton.notifySwitches(EndPosition);
            EndPosition = new Vector3Int(EndPosition.ToVector3 + Vector3.down);
        }
        return(true);
    }
コード例 #11
0
ファイル: Slide.cs プロジェクト: semvidEAFIT/cubeProject
 public Slide(IceCube receiver, Vector3 endPosition, Vector3 direction) : base(receiver, endPosition)
 {
     this.direction = direction;
 }
コード例 #12
0
        //memb meths
        public Player GoToTheStore()
        {
            bool leaveStore = false;

            Console.Clear();
            do
            {
                double tempMoney = player.wallet.CountMoney();
                //do Store things
                Console.WriteLine("You appear at the store.");
                Console.WriteLine("");
                Console.WriteLine("You have $" + tempMoney.ToString() + " money.");
                Console.WriteLine("");

                //INVENTORY REPORT HERE
                player.inventory.InventoryReport();


                Lemon tempLemon = new Lemon();
                Console.WriteLine("0 - Buy lemons for $" + tempLemon.itemPrice.ToString() + ".");
                SugarCube tempSugarCube = new SugarCube();
                Console.WriteLine("1 - Buy sugar cubes for $" + tempSugarCube.itemPrice.ToString() + ".");
                IceCube tempIceCube = new IceCube();
                Console.WriteLine("2 - Buy ice cubes for $" + tempIceCube.itemPrice.ToString() + ".");
                Cup tempCup = new Cup();
                Console.WriteLine("3 - Buy cups for $" + tempCup.itemPrice.ToString() + ".");
                Console.WriteLine("");
                Console.WriteLine("9 - Purchase nothing more.  Leave the store.");
                Console.WriteLine("");
                Console.WriteLine("");

                player.RecipeReport();
                Console.WriteLine("What would you like to purchase from the store?");

                //get user's selection
                string tempInputItem = "";
                try
                {
                    tempInputItem = Console.ReadLine();
                }
                catch (Exception)
                {
                    tempInputItem = "9";
                }

                int tempInputQuantity = 0;

                if (!(tempInputItem == "9"))
                {
                    Console.WriteLine("");
                    Console.WriteLine("How many?");

                    //get user's selection
                    try
                    {
                        tempInputQuantity = Int32.Parse(Console.ReadLine());
                    }
                    catch (Exception)
                    {
                        tempInputQuantity = 0;
                    }
                }
                else
                {
                    leaveStore = true;
                }

                //find the item the player wants to buy in the list
                switch (tempInputItem)
                {
                //add tempInput
                case ("0"):
                    SellStuff("lemon", tempInputQuantity);
                    break;

                case ("1"):
                    SellStuff("sugarCube", tempInputQuantity);
                    break;

                case ("2"):
                    SellStuff("iceCube", tempInputQuantity);
                    break;

                case ("3"):
                    SellStuff("cup", tempInputQuantity);
                    break;

                case ("9"):
                    leaveStore = true;
                    break;

                default:
                    break;
                }

                if (leaveStore)
                {
                    LeaveTheStore();
                }
            } while (!leaveStore);
            return(player);
        }
コード例 #13
0
        private void SellStuff(string itemToSell, int quantity)
        {
            switch (itemToSell)
            {
            case "lemon":
                Lemon tempLemon = new Lemon();
                if (player.wallet.Money >= tempLemon.itemPrice)
                {
                    player.wallet.AdjustMoney(false, (tempLemon.itemPrice * quantity));
                    for (int i = 0; i < quantity; i++)
                    {
                        player.inventory.lemons.Add(tempLemon);
                    }

                    Console.WriteLine("You bought " + quantity + " 'lemon.'");
                }
                break;

            case "sugarCube":
                SugarCube tempSugarCube = new SugarCube();
                if (player.wallet.Money >= tempSugarCube.itemPrice)
                {
                    player.wallet.AdjustMoney(false, (tempSugarCube.itemPrice * quantity));
                    for (int i = 0; i < quantity; i++)
                    {
                        player.inventory.sugarCubes.Add(tempSugarCube);
                    }
                    Console.WriteLine("You bought " + quantity + " 'sugar cube.'");
                }
                break;

            case "iceCube":
                IceCube tempIceCube = new IceCube();
                if (player.wallet.Money >= tempIceCube.itemPrice)
                {
                    player.wallet.AdjustMoney(false, (tempIceCube.itemPrice * quantity));
                    for (int i = 0; i < quantity; i++)
                    {
                        player.inventory.iceCubes.Add(tempIceCube);
                    }
                    Console.WriteLine("You bought " + quantity + " 'ice cube.'");
                }
                break;

            case "cup":
                Cup tempCup = new Cup();
                if (player.wallet.Money >= tempCup.itemPrice)
                {
                    player.wallet.AdjustMoney(false, (tempCup.itemPrice * quantity));
                    for (int i = 0; i < quantity; i++)
                    {
                        player.inventory.cups.Add(tempCup);
                    }
                    Console.WriteLine("You bought " + quantity + " 'cup.'");
                }
                break;

            default:
                break;
            }
            Console.ReadLine();
        }//end SellStuff
コード例 #14
0
ファイル: Slide.cs プロジェクト: semvidEAFIT/cubeProject
 public Slide(IceCube receiver, Vector3 endPosition, Vector3 direction)
     : base(receiver, endPosition)
 {
     this.direction = direction;
 }
コード例 #15
0
ファイル: Player.cs プロジェクト: maxrevilo/ETP_Matus_Atack
        private void shoot(Disparo nuevoTiro)
        {
            foreach (Disparo tiro in Proyectiles)
            {
                if (tiro != null && tiro.Ready())
                {
                    tiro.setVal(nuevoTiro);
                    return;
                }
            }

            Disparo nuevo;

            if (nuevoTiro is IceCube)
                nuevo = new IceCube();
            else
                nuevo = new FireCube();

            nuevo.setVal(nuevoTiro);
            Proyectiles.Add(nuevo);
        }
コード例 #16
0
ファイル: Slide.cs プロジェクト: moreno129/cubeProject
 public Slide(IceCube receiver, Vector3 endPosition) : base(receiver, endPosition)
 {
 }