Inheritance: MonoBehaviour
示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //Implement your edit logic for your module
                if (!Page.IsPostBack)
                {
                    //get a list of users to assign the user to the Object
                    ddlAssignedUser.DataSource = UserController.GetUsers(PortalId);
                    ddlAssignedUser.DataTextField = "Username";
                    ddlAssignedUser.DataValueField = "UserId";
                    ddlAssignedUser.DataBind();

                    //check if we have an ID passed in via a querystring parameter, if so, load that item to edit.
                    //ItemId is defined in the ItemModuleBase.cs file
                    if (ItemId > 0)
                    {
                        var tc = new ItemController();

                        var t = tc.GetItem(ItemId, ModuleId);
                        if (t != null)
                        {
                            txtName.Text = t.ItemName;
                            txtDescription.Text = t.ItemDescription;
                            ddlAssignedUser.Items.FindByValue(t.AssignedUserId.ToString()).Selected = true;
                        }
                    }
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
示例#2
0
 /// <summary>
 /// Проверить возможно ли положить предмет в ячейку.
 /// </summary>
 /// <param name="item">Предмет.</param>
 /// <returns>Можно положить.</returns>
 public virtual bool CheckPutItem(ItemController item)
 {
     var res = true;
     if (Item != null)
         res = !Item.FixedCell;
     return res;
 }
        /***********************************************************************
         *                              Constructor
         ***********************************************************************/
        public AddItem()
        {
            // Standard Silverlight initialization function
            InitializeComponent();

            // Initialize database adapter (controller)
            itemController = new ItemController();
        }
示例#4
0
 /// <summary>
 /// Положить предмет в ячейку.
 /// </summary>
 /// <param name="item">Предмет.</param>
 /// <returns>В случаи удачного действия возвращает true.</returns>
 public virtual bool PutItem(ItemController item)
 {
     if (!CheckPutItem(item))
         return false;
     if (item != null)
         item.transform.SetParent(transform, false);
     this.Item = item;
     return true;
 }
示例#5
0
 public void MakeAShootAtB(ItemController itemFrom, ItemController itemTo)
 {
     Vector3 fromPosition = itemFrom.gameObject.transform.position;
     Vector3 toPosition = itemTo.gameObject.transform.position;
     Vector3 relativePos = toPosition - fromPosition;
     linesCollection.GetLineControllerBetween (itemFrom.GetId (), itemTo.GetId ()).Activate();
     itemFrom.StartShootingAt (Quaternion.LookRotation(relativePos), itemTo.GetId());
     map.AshootsAtB (itemFrom.GetId (), itemTo.GetId ());
 }
示例#6
0
    /// <summary>
    /// Включить доступность ячейки экипировки определённого типа.
    /// </summary>
    /// <param name="typeItem">Тип предмета.</param>
    /// <param name="nullCell">Выделять только пустые ячейки.</param>
    /// <param name="item">Не выделять ячейки содержащие данный предмет.</param>
    public void EnableAvailableCells(ItemType typeItem, bool nullCell, ItemController item)
    {
        foreach (EquipmentCellController cell in _cells)
        {
            var available = (cell.TypeItem == typeItem);
            if (nullCell)
                available &= (cell.Item == null);
            if (item != null && item == cell.Item)
                available = false;

            cell.SetAvailable(available);
        }
    }
示例#7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         var tc = new ItemController();
         rptItemList.DataSource = tc.GetItems(ModuleId);
         rptItemList.DataBind();
     }
     catch (Exception exc) //Module failed to load
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
示例#8
0
 /// <summary>
 /// Создать клона указанного предмета в указанной ячейки.
 /// </summary>
 /// <param name="cell">Ячейка в которой будет создан клон.</param>
 /// <param name="item">Предмет для клонирования.</param>
 public static ItemController CreateCloneItem(CellController cell, ItemController item)
 {
     ItemController clone = null;
     if (cell.CheckPutItem(item))
     {
         clone = Instantiate(item);
         clone.BaseItem = item.BaseItem;
         // TODO: Случайно задаём редкость предмета.
         clone.RarityItem = (Rarity)UnityEngine.Random.Range(0, 4);
         cell.PutItem(clone);
     }
     return clone;
 }
示例#9
0
        public void rptItemListOnItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Edit")
            {
                Response.Redirect(EditUrl(string.Empty, string.Empty, "Edit", "tid=" + e.CommandArgument));
            }

            if (e.CommandName == "Delete")
            {
                var tc = new ItemController();
                tc.DeleteItem(Convert.ToInt32(e.CommandArgument), ModuleId);
            }
            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
        }
示例#10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     itemCtrl = new ItemController();
     userCtrl = new UserCtrl();
     smsCtrl = new TextCallController();
     MsgPanel.Visible = false;
     if(Request.QueryString["success"] != null)
     {
         SuccessPanel.Visible = true;
     }
     else
     {
         SuccessPanel.Visible = false;
     }
 }
 protected override void OnAwake()
 {
     if(pc == null){
         Debug.LogError("No" + pc.getName() + "attached to this object");
     }
     if(aimer == null){
         Debug.LogError("No Aimer attached to this object");
     }
     localMover = GetComponent<Mover>();
     localJumper = GetComponent<Jumper>();
     //onewaybypass = transform.FindChild("OneWayPlatformCollider").GetComponent<OneWayBypass>();
     animator = GetComponent<Animator>();
     itemController = GetComponentInChildren<ItemController>();
     interactFinder = GetComponentInChildren<InteractableFinder>();
     inventory = GetComponent<PlayerInventory>();
     alignment = AlignmentType.FRIENDLY;
 }
示例#12
0
        /// <summary>
        /// Main window constructor
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            instance = this;

            Process[] processes = Process.GetProcessesByName("StarCraft");
            if (processes.Length > 0)
            {
                sharp = new MemorySharp(processes[0]);

                UnitsController = new ItemController<Unit>(Units, unitTab, unitList);
                SpritesController = new ItemController<Sprite>(Sprites, spriteTab, spriteList);
                ImagesController = new ItemController<Image>(Images, imageTab, imageList);
                ExtraImagesController = new ItemController<Image>(ExtraImages, extraImageTab, extraImageList);
                HPImagesController = new ItemController<Image>(HPImages, hpImageTab, hpImageList);
            }
        }
	public static void selectMe(ItemController other){
		if (item != null) {
			item.deselect ();

			if (item.name != other.name) {
				item = other;
				text = item.getText();
			} else {
				item = null;
				text = "none";
			}

		} else {
			item = other;
			text = item.getText();

		}


	}
示例#14
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var t = new Item();
            var tc = new ItemController();

            if (ItemId > 0)
            {
                t = tc.GetItem(ItemId, ModuleId);
                t.ItemName = txtName.Text.Trim();
                t.ItemDescription = txtDescription.Text.Trim();
                t.LastModifiedByUserId = UserId;
                t.LastModifiedOnDate = DateTime.Now;
                t.AssignedUserId = Convert.ToInt32(ddlAssignedUser.SelectedValue);
            }
            else
            {
                t = new Item()
                {
                    AssignedUserId = Convert.ToInt32(ddlAssignedUser.SelectedValue),
                    CreatedByUserId = UserId,
                    CreatedOnDate = DateTime.Now,
                    ItemName = txtName.Text.Trim(),
                    ItemDescription = txtDescription.Text.Trim(),
                    
                };
            }

            t.LastModifiedOnDate = DateTime.Now;
            t.LastModifiedByUserId = UserId;
            t.ModuleId = ModuleId;

            if (t.ItemId > 0)
            {
                tc.UpdateItem(t);
            }
            else
            {
                tc.CreateItem(t);
            }
            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            userController = new SearchUserController();
            itemCtrl = new ItemController();

            if (Request.QueryString["userId"] != null)
            {
                singleUser = userController.getSingleUser(Request.QueryString["userId"]);

                if (singleUser != null)
                {
                    LblUserName.Text = singleUser.FirstName + " " + singleUser.LastName;
                    LblAddress.Text = singleUser.Address;
                    LblCity.Text = singleUser.City;
                    LblState.Text = singleUser.State;
                    LblHomePhone.Text = singleUser.Phone;
                    LblMobilePhone.Text = formatPhoneNum(singleUser.Phone);
                    lblZip.Text = singleUser.Zip.ToString();
                    LblEmail.Text = singleUser.Email;

                    if (!singleUser.Text)
                    {
                        BtnText.Visible = false;
                        SMSMessage.Visible = false;
                    }
                }

            }

            if (!Page.IsPostBack)
            {
                MessageSent.Visible = false;
                EmailSentMsg.Visible = false;

            }

            InvoiceView.DataBind();
            InvoiceView.Rows[InvoiceView.Rows.Count-1].Cells[6].Controls[0].Visible = false;
            InvoiceView.Rows[InvoiceView.Rows.Count-2].Cells[6].Controls[0].Visible = false;
            InvoiceView.Rows[InvoiceView.Rows.Count-3].Cells[6].Controls[0].Visible = false;
        }
示例#16
0
    /// <summary>
    /// Попытаться модифицировать предмет на 1.
    /// </summary>
    /// <param name="item">Предмет для модификации.</param>
    /// <returns>Результат модификации.</returns>
    public static bool ModificationItem(ItemController item)
    {
        var str = string.Empty;
        var res = false;

        // TODO: В 50% случаев предмет модифицируется.
        var rnd = UnityEngine.Random.Range(0, 2);
        if (rnd == 0)
        {
            item.Modification++;
            res = true;

            str = "<color=green>Успешная</color> модификация предмета \"{0}\".";
        }
        else
            str = "<color=red>Не удалось</color> модифицировать предмет \"{0}\".";

        LogController.Instance.AddString(String.Format(str, item.name));

        return res;
    }
示例#17
0
	// ================================================================ //
	// 통신에 관련 함수.
	
	
	// 아이템 상태 변경 통지 함수.
	private void SendItemStateChanged(string item_id, ItemController.State state, string owner_id)
	{
		if(m_network == null) {
			return;
		}
		
		Debug.Log("SendItemStateChanged.");
		
		// 아이템 획득 문의.
		ItemData data = new ItemData();
		
		data.itemId = item_id;
		data.ownerId = owner_id;
		data.state = (int)state;
		
		ItemPacket packet = new ItemPacket(data);

		int serverNode = m_network.GetServerNode();
		Debug.Log("ServerNode:" + serverNode);
		m_network.SendReliable<ItemData>(serverNode, packet);
		
		string log = "[CLIENT] SendItemStateChanged " +
			"itemId:" + item_id +
				" state:" + state.ToString() + 
				" ownerId:" + owner_id;
		Debug.Log(log);
		dbwin.console().print(log);
	}
示例#18
0
	// 아이템 상태 변경.
	public void	setItemState(string name, ItemController.State state, string owner)
	{
		GameObject[]	items = GameObject.FindGameObjectsWithTag("Item");

		if (items.Length == 0) {
			return;
		}

		GameObject go = System.Array.Find(items, x => x.name == name);

		if (go == null) {
			return;
		}

		ItemController	item = go.GetComponent<ItemController>();
	
		if (item == null) {
			return;
		}

		item.state = state;
		item.owner_account = owner;

		string log = "Item state changed => " + 
					 "[item:" + name + "]" + 
					 "[state:" + state.ToString() + "]" +
					 "[owner:" + owner + "]";
		Debug.Log(log);
		dbwin.console().print(log);
	}
示例#19
0
 public static ItemController Fixture()
 {
     ItemController controller = new ItemController(new ItemRepository(), "", new LoginView());
     return controller;
 }
示例#20
0
	void PickupItem (ItemController newitem) {
        string newType = newitem.itemType;
		if (!testingObj) {
			if (item != null) {
				item = item.CombineWith (newType);
			} else {
				// just to get it working... will look for more elegant ways later...
				if (newType == "Defense") {
					item = gameObject.AddComponent<DefenseItem> () as DefenseItem;
				} else if (newType == "Offense") {
					item = gameObject.AddComponent<OffenseItem> () as OffenseItem;
				} else if (newType == "Speed") {
					item = gameObject.AddComponent<SpeedItem> () as SpeedItem;
				}
                newitem.gameObject.SendMessage("NotifySpawner");
                EffectsManager.GetInstance().DisplayItemEffect(newitem.gameObject.transform.position);
                Destroy(newitem.gameObject);
			}
			ItemStateUI.UpdateForPlayer (playerNum, item);
		}
	}
示例#21
0
	// 소유 중인 아이템을 버려도 되는가?.
	public QueryItemDrop	queryDropItem(string owner_id, ItemController item, bool local)
	{
		QueryItemDrop		query = null;

		do {
			
			// 자신의 것이 아닌 것은 주울 수 없습니다.
			if(item.picker != owner_id) {

				break;
			}

			query = new QueryItemDrop(item.id);

			this.queries.Add(query);

		} while(false);

		if(item != null && local) {
			// 아이템의 스테이트를 네트워크에 보냅니다.
			SendItemStateChanged(item.id, ItemController.State.Dropping, owner_id);
		}

		return(query);
	}
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["itemId"] != null)
            {
                string selectedItemId = Request.QueryString["itemId"];
                ItemController itemCtrl = new ItemController();
                UserCtrl userCtrl = new UserCtrl();

                Item result = itemCtrl.getItemByID(selectedItemId);
                ItemID.Text = result.CategoryID + result.ItemID;
                ItemName.Text = result.ItemName;
                lblCurrentPrice.Text = String.Format("{0:0.##}", result.ItemValue);
                lblMinPrice.Text = String.Format("{0:0.##}", result.MinBid);
                lblAngelPrice.Text = String.Format("{0:0.##}", result.AngelPrice);
                ItemDesc.Text = result.Description.ToString();

                if (String.IsNullOrEmpty(result.UserID.ToString()))
                {
                    LblItemStatus.Text = "UnSold";
                    LblItemStatus.CssClass = "ui grey ribbon big label";
                }
                else
                {
                    if (result.Paid)
                    {
                        LblItemStatus.Text = "Paid";
                        LblItemStatus.CssClass = "ui green ribbon big label";
                    }
                    else
                    {
                        LblItemStatus.Text = "Sold";
                        LblItemStatus.CssClass = "ui red ribbon big label";
                    }
                }

                User buyer = userCtrl.getBuyerInfo(result.UserID.ToString());

                if (buyer !=null)
                {
                    BuyerName.Text = buyer.FirstName + " " + buyer.LastName;
                    BuyerEmail.Text = buyer.Email;
                    BuyerPhone.Text = "(" + buyer.Phone.Substring(0, 3) + ")" + buyer.Phone.Substring(3, 3) + "-" + buyer.Phone.Substring(6);
                }
                else
                {

                        LblItemStatus.Text = "UnSold";
                        LblItemStatus.CssClass = "ui grey ribbon big label";
                }

                List<User> designers = itemCtrl.getDesigners(selectedItemId);

                if (designers != null)
                {
                    foreach (User d in designers)
                    {
                        DesignerName.Text += d.FirstName + " " + d.LastName + " ";
                    }
                }

                SponsorName.Text = itemCtrl.getSponsorName(result.CategoryID);

            }
        }
示例#23
0
	// 운반 종료.
	public void		endCarry()
	{
		this.item = null;
	}
示例#24
0
	// 운반 시작(연출은 취소).
	public void		beginCarryAnon(ItemController item)
	{
		this.beginCarry(item);

		this.item.gameObject.transform.parent      = this.character.gameObject.transform;
		this.item.gameObject.GetComponent<Rigidbody>().isKinematic = true;
		this.item.gameObject.GetComponent<Collider>().enabled      = true;

		this.item.transform.localPosition = this.ip_jump.goal;
		this.item.transform.rotation      = Quaternion.identity;

		this.is_landed = true;
	}
示例#25
0
	// ================================================================ //

	// 운반 시작.
	public void		beginCarry(ItemController item)
	{
		item.gameObject.GetComponent<Rigidbody>().isKinematic   = true;
		item.gameObject.GetComponent<Collider>().enabled        = false;

		Vector3		start = item.transform.position - this.character.transform.position;
		Vector3		goal  = new Vector3(0.0f, chrController.CARRIED_ITEM_HEIGHT, 0.0f);

		this.ip_jump.start(start, goal, chrController.CARRIED_ITEM_HEIGHT + 1.0f);

		this.item = item;

		this.pivot = Quaternion.AngleAxis(90.0f, Vector3.up)*this.ip_jump.xz_velocity();
		this.pivot.Normalize();
		this.omega = 360.0f/(this.ip_jump.t0 + this.ip_jump.t1);
		this.angle = 0.0f;

		this.spin_center = 0.0f;

		switch(this.item.name.ToLower()) {

			case "tarai":	this.spin_center = 0.0f;	break;
			case "negi":	this.spin_center = 0.5f;	break;
			case "yuzu":	this.spin_center = 0.25f;	break;
			case "wan":		this.spin_center = 0.5f;	break;
			case "cat":		this.spin_center = 0.5f;	break;
		}

		this.is_landed = false;
	}
示例#26
0
	// 가지고 있는 아이템을 버립니다.
	public void 	dropItem(string owner_id, ItemController item)
	{
		item.picker = "";
	}
示例#27
0
 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
 {
     itemCtrl = new ItemController();
     itemCtrl.selectCategory(DropDownList1.SelectedValue);
 }
示例#28
0
 /// <summary>
 /// Положить предмет в ячейку.
 /// </summary>
 /// <param name="item">Предмет.</param>
 /// <param name="cell">Ячейка.</param>
 public static bool SetItemInCell(ItemController item, CellController cell)
 {
     if (cell == null)
         throw new NullReferenceException("Ячейка не может быть NULL.");
     return cell.PutItem(item);
 }
示例#29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     itemCtrl = new ItemController();
     userCtrl = new UserCtrl();
 }
示例#30
0
	// ================================================================ //
	
	public void	consumeKey(ItemController item)
	{
		Debug.Log ("consumeKey");

		if(item.type == "key04") {

			// 플로어 이동키.
			Debug.Log("UNLOCK FLOOR DOOR!!");
			MapCreator.get().UnlockBossDoor();

		} else {

			RoomController	room = MapCreator.get().getRoomFromPosition(transform.position);

			room.OnConsumedKey(item.type);
		}
	}