public slot Copy()
 {
     slot s= new slot();
     s.icon = icon;
     s.skill = skill;
     return s;
 }
        public string getMessage(slot _slot, int diffInDay)
        {
            string retVal = "";
            string msg    = "";

            if (diffInDay == 0)
            {
                msg = "today";
            }
            else if (diffInDay == 3)
            {
                msg = "in 3 days";
            }
            else if (diffInDay == 7)
            {
                msg = "in 7 days";
            }

            if (_slot.type == "manage")
            {
                retVal = "Your subscription for Tittler slot #" + _slot.position + " expires " + msg + ". Please extend your subscription to continue managing your Tittler.";
            }
            else if (_slot.type == "access")
            {
                retVal = "Your subscription for Parent slot #" + _slot.position + " expires " + msg + ". Please extend your subscription to continue accessing your account.";
            }

            return(retVal);
        }
示例#3
0
    //Update player position
    public Vector3 UpdatePos(Vector2Int move)
    {
        //output will be one of this two
        Vector2Int prevPos = playerPos;
        Vector2Int nextPos = playerPos + move;

        //if out of bounds, stay in place
        if (OutofBounds(nextPos))
        {
            return(Get3DPos(prevPos, player.transform.position.y));
        }


        //if it is solid, stay in place
        if (GetSlot(nextPos).isSolid == true)
        {
            return(Get3DPos(prevPos, player.transform.position.y));
        }


        //occupy previous position
        PutBlock(prevPos);

        //call delegate
        MoveTime();

        //update position
        playerPos = nextPos;

        //get new position
        slot s = GetSlot(playerPos);

        //check if it is a bomb
        if (s.type == 6)
        {
            //create explosion
            Explode(playerPos);

            //destroy
            Destroy(s.go);

            //set slot as empty
            SetSlot(playerPos, 0, null, false);
        }
        //check if it is a coin
        else if (s.type == 7)
        {
            //destroy
            Destroy(s.go);

            //set slot as empty
            SetSlot(playerPos, 0, null, false);

            currentCoins--;
        }

        CheckWin();

        return(Get3DPos(nextPos, player.transform.position.y));
    }
示例#4
0
    void upgradeChosse(SlotController sc, slot s)
    {
        int i = 0;                 // indice

        foreach (Cards c in Cards) // em todos os itens da card
        {
            if (slotChosse[i]._GameController == null)
            {
                slotChosse[i]._GameController = this;     // para pegar a instancia do prorpio script
            }
            if (slotChosse[i].Card == null)
            {
                slotChosse[i].Card = c;
            }

            slotChosse[i].sc = sc;
            slotChosse[i].s  = s;

            slotChosse[i].upgradeInfoCard();    //para atualizar as informaçoes

            if (slotChosse[i].Card.isLiberate == true)
            {
                slotChosse[i].gameObject.SetActive(true);    //ativa
            }

            i++;
        }
    }
示例#5
0
    //make bomb explosion
    public void Explode(Vector2Int origin)
    {
        //iterate 3x3 blocks around it
        for (int i = origin.x - 1; i <= origin.x + 1; i++)
        {
            for (int j = origin.y - 1; j <= origin.y + 1; j++)
            {
                //create black explosion block
                Instantiate(explosionFab, Get3DPos(new Vector2Int(i, j)), Quaternion.identity);

                //get slot at that position
                slot s = GetSlot(new Vector2Int(i, j));

                //if it is solid destroy it TODO this line doesnt work always??
                if (s.isSolid)
                {
                    //destroy
                    Destroy(s.go);

                    //set slot as empty
                    SetSlot(new Vector2Int(i, j), 0, null, false);
                }
            }
        }
    }
示例#6
0
    public void activeSlot(slot s, SlotController sc, int idCard)
    {
        panelChosseCard.SetActive(false);
        s.slotCard = Cards[idCard];

        iconBuild.sprite       = s.slotCard.spriteCard;
        buyDescriptionTxt.text = "Você liberou <color=#FFFF00>" + s.slotCard.cardName + "</color>";

        panelBuy.SetActive(true);

        getGold(s.slotPrice * -1);    //tirar o dinheiro
        s.isPurchased         = true; // comprou
        s.slotCard.isLiberate = true; //liberou
        s.startSlotScriptable();      //inicializou

        sc.SlotStart();

        //2 Q
        if (isQuest == true && idQuest == 2)
        {
            updateQuest();
        }

        saveSlot(s);
    }
示例#7
0
 public bool AddItem(Item item)    // inventory on player and then call when wanting to add item
 {
     if (item.maxSize == 1)
     {
         PlaceEmpty(item);
         return(true);
     }
     else
     {
         foreach (GameObject slot in allSlots)
         {
             slot tmp = slot.GetComponent <slot>();
             if (!tmp.IsEmpty)
             {
                 if (tmp.CurrentItem.type == item.type && tmp.CanStack)
                 {
                     tmp.AddItem(item);
                     return(true);
                 }
             }
         }
         if (emptySlots > 0)
         {
             PlaceEmpty(item);
         }
     }
     return(false);
 }
 // Set up gameboard and players
 public override void gameSetup()
 {
     //Set up gameboard and view
     base.gameSetup();
     //Online Multiplayer Setup
     myHand = new List<int>();
     MultiplayerController.Instance.gp = this;
     myself = MultiplayerController.Instance.getMyself();
     participants = MultiplayerController.Instance.getParticipants();
     if (myself == participants [0]) {
         playerType = slot.Red;
         playerColor = Color.red;
         opponentType = slot.Blue;
         opponentColor = Color.blue;
         opponent = participants[1];
         TakeTurn();
     }
     else{
         playerType = slot.Blue;
         playerColor = Color.blue;
         opponentType = slot.Red;
         opponentColor = Color.red;
         opponent = participants[0];
         base.clearHandArea();
     }
 }
示例#9
0
 public ActionResult Edit([Bind(Include = "SlotID,slotTime,isActive")] slot slots)
 {
     try {
         var s = repo.Single(slots.SlotID);
         if (s == null)
         {
             return(HttpNotFound());
         }
         s.slotTime      = slots.slotTime;
         s.dataIsUpdated = BaseUtil.GetCurrentDateTime();
         s.modifiedBy    = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.UserID.ToString()));
         s.isActive      = slots.isActive;
         if (ModelState.IsValid)
         {
             slots.modifiedBy    = Convert.ToInt64((BaseUtil.GetSessionValue(AdminInfo.employerID.ToString())));
             slots.dataIsUpdated = BaseUtil.GetCurrentDateTime();
             repo.Update(s);
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception e)
     {
         BaseUtil.CaptureErrorValues(e);
     }
     return(View(slots));
 }
        public void pupdate(int reqid)
        {
            DataClassesDataContext context = new DataClassesDataContext();
            slot upd = context.slots.Single(i => i.id == reqid);

            upd.stat = "pending";
            context.SubmitChanges();
        }
示例#11
0
    public slot Copy()
    {
        slot s = new slot();

        s.icon  = icon;
        s.skill = skill;
        return(s);
    }
示例#12
0
    public static void CreateNewItem(Items item)
    {
        slot newItem = Instantiate(instance.slotPrefab, instance.slotGrid.transform.position, Quaternion.identity);

        newItem.gameObject.transform.SetParent(instance.slotGrid.transform);
        newItem.slotItem         = item;
        newItem.slotImage.sprite = item.itemImage;
        newItem.slotNum.text     = item.itemHeld.ToString();
    }
示例#13
0
    public static void creatitem(item se_item)
    {
        slot newitem = Instantiate(instance.m_slot_prefab, instance.m_slot_grid.transform.position, Quaternion.identity);

        newitem.gameObject.transform.SetParent(instance.m_slot_grid.transform);
        newitem.m_slot_item         = se_item;
        newitem.m_slot_image.sprite = se_item.m_image;
        newitem.m_slot_number.text  = se_item.m_num.ToString();
    }
示例#14
0
    public static bool Init()
    {
        globalCD = 0;
        Keybinds.Add(KeyCode.Alpha1);
        Keybinds.Add(KeyCode.Alpha2);
        slot s;
        s = new slot(); s.skill = sCharactersManager.characters[0].skills[0]; Bar1.Add(s);

        return true;
    }
示例#15
0
 public void UpdateSlot(int id, slot entity) //implementation of UpdateSlot(int id, slot entity) in ISlotControllerManager
 {
     try
     {
         _slotService.Update(id, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#16
0
    public static bool Init()
    {
        globalCD = 0;
        Keybinds.Add(KeyCode.Alpha1);
        Keybinds.Add(KeyCode.Alpha2);
        slot s;

        s = new slot(); s.skill = sCharactersManager.characters[0].skills[0]; Bar1.Add(s);

        return(true);
    }
示例#17
0
 public void RemoveSlot(slot entity) //implementation of RemoveSlot(slot entity) in ISlotControllerManager
 {
     try
     {
         _slotService.Remove(entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#18
0
        public IHttpActionResult Getslot(int id)
        {
            slot slot = _slotControllerManager.GetSlot(id);

            if (slot == null)
            {
                return(NotFound());
            }

            return(Ok(slot));
        }
        public slot getSlotTime(int slotId)
        {
            sports      = new SportsAllEntities();
            slotTimings = new slot();
            var SelSlotTime = from x in sports.slots
                              where x.SlotId == slotId
                              select x;

            slotTimings = SelSlotTime.First <slot>();
            return(slotTimings);
        }
示例#20
0
 public void itemUse(int id, slot slot)
 {
     if (id == 1)
     {
         GM._PlayerScript.currentHunger += 10;
         if (GM._PlayerScript.currentHunger > 100)
         {
             GM._PlayerScript.currentHunger = 100;
         }
         slot.clearSlot();
     }
 }
示例#21
0
        public IHttpActionResult Deleteslot(int id)
        {
            slot slot = _slotControllerManager.GetSlot(id);

            if (slot == null)
            {
                return(NotFound());
            }

            _slotControllerManager.RemoveSlot(slot);

            return(Ok(slot));
        }
        public slot getSlotIdAndTime(int bookId)
        {
            sports     = new SportsAllEntities();
            bookSlotId = new booking();
            var SelSlotId = from x in sports.bookings
                            where x.BookingId == bookId
                            select x;

            bookSlotId = SelSlotId.First <booking>();
            slot slotTime = getSlotTime(bookSlotId.SlotID);

            return(slotTime);
        }
示例#23
0
 public ActionResult Edit(int id, slot entity)
 {
     try
     {
         HttpResponseMessage response = GlobalVariables.Place4meWebAPIClient.PutAsJsonAsync("Slots/" + id, entity).Result;
         TempData["SuccessMessage"] = "Update Successfully";
         return(RedirectToAction("Index", "Carparks"));
     }
     catch
     {
         return(View());
     }
 }
示例#24
0
 public ActionResult Create(slot entity)
 {
     try
     {
         HttpResponseMessage response = GlobalVariables.Place4meWebAPIClient.PostAsJsonAsync("Slots", entity).Result;
         TempData["SuccessMessage"] = "Saved Successfully";
         return(RedirectToAction("Index", "Carparks"));
     }
     catch (Exception)
     {
         return(View());
     }
 }
示例#25
0
        // GET: TimeSlots/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            slot slot = await db.slots.FindAsync(id);

            if (slot == null)
            {
                return(HttpNotFound());
            }
            return(View(slot));
        }
示例#26
0
    public bool attach(slot s)
    {
        if (!slots.Contains(s.index))
        {
            return(false);
        }
        int index = s.index;

        addSlot(index + 1);
        this.maxIdx = index + 1 > this.maxIdx ? index + 1 : this.maxIdx;
        addSlot(index - 1);
        this.minIdx = index - 1 < this.minIdx ? index - 1 : this.minIdx;
        return(true);
    }
示例#27
0
    public void buySlot(slot s, SlotController sc)
    {
        changeGameState(GameState.CUT);
        panelGameplay.SetActive(false);
        panelFume.SetActive(true);

        if (isChosseCard == false)
        {
            activeSlot(s, sc, s.slotCard.idCard);
        }
        else if (isChosseCard == true)
        {
            upgradeChosse(sc, s);
            panelChosseCard.SetActive(true);
        }
    }
        public void insert(cslot u)
        {
            var ins = new slot
            {
                id       = u.id,
                vdate    = u.vdate,
                stat     = u.stat,
                feedback = u.feedback,
                org      = u.org,
                uid      = u.uid
            };
            DataClassesDataContext context = new DataClassesDataContext();

            context.slots.InsertOnSubmit(ins);
            context.SubmitChanges();
        }
示例#29
0
        // GET: Admin/Slot/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            slot slots = null;

            try {
                slots = repo.Single(id);
            }
            catch (Exception e)
            {
                BaseUtil.CaptureErrorValues(e);
            }
            return(View(slots));
        }
示例#30
0
        public IHttpActionResult Putslot(int id, slot slot)
        {
            if (id != slot.slot_id)
            {
                return(BadRequest());
            }

            try
            {
                _slotControllerManager.UpdateSlot(id, slot);

                slot_details entity = new slot_details();

                if (slot.slot_isFree == 1)
                {
                    entity.slot_id = id;
                    entity.slot_details_parked_date = DateTime.Now.Date;
                    entity.slot_details_parked_time = DateTime.Now.ToString("HH:mm:ss");
                    _slotDetailsControllerManager.AddSlotDetail(entity);
                }
                else if (slot.slot_isFree == 0)
                {
                    slot_details existingEntity = _slotDetailsControllerManager.GetSlotDetail(id);
                    existingEntity.slot_details_parked_end_time = DateTime.Now.ToString("HH:mm:ss");
                    _slotDetailsControllerManager.UpdateSlotDetail(existingEntity.slot_details_id, existingEntity);
                }
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_slotControllerManager.SlotExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#31
0
 public ActionResult Create([Bind(Include = "slotTime,isActive")] slot Slot)
 {
     try {
         if (ModelState.IsValid)
         {
             Slot.createdBy     = Convert.ToInt64((BaseUtil.GetSessionValue(AdminInfo.employerID.ToString())));
             Slot.modifiedBy    = Convert.ToInt64((BaseUtil.GetSessionValue(AdminInfo.employerID.ToString())));
             Slot.dataIsCreated = BaseUtil.GetCurrentDateTime();
             Slot.dataIsUpdated = BaseUtil.GetCurrentDateTime();
             repo.Insert(Slot);
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception e)
     {
         BaseUtil.CaptureErrorValues(e);
     }
     return(View(Slot));
 }
示例#32
0
    public void loadSlot(slot s)
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Open(Application.persistentDataPath + "/slotData" + s.idSlot + ".dat", FileMode.Open); // o lugar q salva
        saveDataSlot    data = (saveDataSlot)bf.Deserialize(file);                                                         //deserializando e coloca na data

        s.slotCard         = Cards[data.idCard];                                                                           // vai pegar o id da gamemanager
        s.isPurchased      = data.isPurchased;
        s.isMax            = data.isMax;
        s.isAutoProduction = data.isAutoProduction;
        s.slotLevel        = data.slotLevel;
        s.upgrades         = data.upgrades;
        s.totalUpgrades    = data.totalUpgrades;
        //s.upgradePrice = data.upgradePrice;
        s.slotProductionMultiplier = data.slotProductionMultiplier;
        s.slotProductionReduction  = data.slotProductionReduction;

        file.Close();
    }
示例#33
0
    public void saveSlot(slot s)
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/slotData" + s.idSlot + ".dat"); // o lugar q salva
        saveDataSlot    data = new saveDataSlot();                                                            // para instanciar

        data.idCard           = s.slotCard.idCard;
        data.isPurchased      = s.isPurchased;
        data.isMax            = s.isMax;
        data.isAutoProduction = s.isAutoProduction;
        data.slotLevel        = s.slotLevel;
        data.upgrades         = s.upgrades;
        data.totalUpgrades    = s.totalUpgrades;
        //data.upgradePrice = s.upgradePrice;
        data.slotProductionMultiplier = s.slotProductionMultiplier;
        data.slotProductionReduction  = s.slotProductionReduction;

        bf.Serialize(file, data);//seriarizando colocando essas informaçoes nesse arquivo
        file.Close();
    }
示例#34
0
		/**
		 * Drops a weapon from a slot.
		 *
		 * You can use global constants SLOT_PRIMARY, SLOT_SECONDARY, SLOT_THROW,
		 * SLOT_MEDKIT (also works for defibs), SLOT_PILLS (also works for adrenaline etc)
		 */
		void DropWeaponSlot(slot);