• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Village类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Village的典型用法代码示例。如果您正苦于以下问题:C# Village类的具体用法?C# Village怎么用?C# Village使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Village类属于命名空间,在下文中一共展示了Village类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateComponent

    //constructor
    public static Unit CreateComponent( UnitType unitType, Tile location, Village v, GameObject PeasantPrefab )
    {
        Tile toplace = null;
        foreach (Tile a in location.getNeighbours())
        {
            if(a.prefab == null && a.getOccupyingUnit() == null && a.getColor() == location.getColor())
            {
                toplace = a;
            }
        }
        if(toplace == null)
        {
            toplace = location;
        }
        GameObject o = Instantiate(PeasantPrefab, new Vector3(toplace.point.x, 0.15f, toplace.point.y), toplace.transform.rotation) as GameObject;
        Unit theUnit = o.AddComponent<Unit>();
        theUnit.locatedAt = toplace;

        theUnit.myType = unitType;
        theUnit.myVillage = v;
        theUnit.myAction = UnitActionType.ReadyForOrders;

        location.setOccupyingUnit (theUnit);
        return theUnit;
    }
开发者ID:hysoftwareeng,项目名称:MedievalWarfare,代码行数:26,代码来源:Unit.cs


示例2: ChurchInfo

 public ChurchInfo(Village village, int churchLevel, Color color)
 {
     Village = village;
     ChurchLevel = churchLevel;
     Color = color;
     Transparancy = 50;
 }
开发者ID:kindam,项目名称:TWTactics,代码行数:7,代码来源:ChurchInfo.cs


示例3: Baths

 public Baths(Village v)
     : base(v)
 {
     Name = "Thermes";
     Hp = MaxHp = 50;
     this.CostPrice = 500;
 }
开发者ID:EmilieS,项目名称:Gleipnir,代码行数:7,代码来源:Baths.cs


示例4: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        inPage p = (inPage)this.Master;
        village = p.CurrentVillage;
        
        int iType = 0;
        int.TryParse(Request["type"], out iType);

        PlayerSettingType type = PlayerSettingFactory.GetPlayerSettingType(iType);

        this.tbProfileType.Rows[(int)type].Cells[0].Attributes.Add("class", "selected");
        
        switch (type)
        {
            case PlayerSettingType.Email:
                ChangeEmailAddress ucChangeEmailAddress = (ChangeEmailAddress)Page.LoadControl("ChangeEmailAddress.ascx");
                this.pProfile.Controls.Add(ucChangeEmailAddress);
                return;
                break;
            case PlayerSettingType.ChangePassword:
                ChangePassword ucChangePassword = (ChangePassword)Page.LoadControl("ChangePassword.ascx");
                this.pProfile.Controls.Add(ucChangePassword);
                return;
                break;
            default:
                UserProfile ucUserProfile = (UserProfile)Page.LoadControl("UserProfile.ascx");
                this.pProfile.Controls.Add(ucUserProfile);
                return;
                break;
        }

    }
开发者ID:DF-thangld,项目名称:web_game,代码行数:32,代码来源:user_profile.aspx.cs


示例5: initializeCannon

    public void initializeCannon(Village v, GameObject cannonPrefab)
    {
        Tile tileAt = v.getLocatedAt ();
        GameObject newCannon = Network.Instantiate(cannonPrefab, new Vector3(tileAt.point.x, 0.15f, tileAt.point.y), tileAt.transform.rotation, 0) as GameObject;
        Unit u = newCannon.GetComponent<Unit>();

        Tile toplace = null;
        foreach (Tile a in tileAt.getNeighbours())
        {
            if(a.prefab == null && a.getOccupyingUnit() == null && a.getColor() == tileAt.getColor())
            {
                toplace = a;
            }
        }
        if(toplace == null)
        {
            toplace = tileAt;
        }
        gameObject.networkView.RPC ("moveUnitPrefabNet",RPCMode.AllBuffered,u.networkView.viewID,new Vector3(toplace.point.x, 0.15f, toplace.point.y));
        u.networkView.RPC ("setLocationNet", RPCMode.AllBuffered, toplace.networkView.viewID);
        u.networkView.RPC ("setUnitTypeNet", RPCMode.AllBuffered, (int)UnitType.CANNON);
        u.networkView.RPC ("setVillageNet", RPCMode.AllBuffered, v.networkView.viewID);
        u.networkView.RPC ("setActionNet", RPCMode.AllBuffered, (int)UnitActionType.ReadyForOrders);
        u.getLocation ().networkView.RPC ("setOccupyingUnitNet", RPCMode.AllBuffered, u.networkView.viewID);
        v.gameObject.networkView.RPC("addGoldNet", RPCMode.AllBuffered, -35);
        v.gameObject.networkView.RPC("addWoodNet", RPCMode.AllBuffered, -12);
        v.gameObject.networkView.RPC("addUnitNet", RPCMode.AllBuffered, newCannon.networkView.viewID);
    }
开发者ID:hysoftwareeng,项目名称:MedievalWarfare,代码行数:28,代码来源:UnitManager.cs


示例6: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {

        inPage p = (inPage)this.Master;
        village = p.CurrentVillage;

        int village_id;
        int.TryParse(Request["village"], out village_id);
        if (village_id == 0)
        {
            Response.Redirect("village.aspx?id=" + this.village.ToString(), true);
            return;
        }

        ISession session = (ISession)Context.Items[Constant.NHibernateSessionSign];
        target = session.Get<Village>(village_id);

        if (target == null)
        {
            this.pHasVillage.Visible = false;
            this.pVillageNotFound.Visible = true;
            return;
        }

        this.pHasVillage.Visible = true;
        this.pVillageNotFound.Visible = false;

        if (this.target.Player.ID == (int)Session["user"])
            this.pIsOwner.Visible = true;
        else
            this.pIsOwner.Visible = false;
    }
开发者ID:DF-thangld,项目名称:web_game,代码行数:32,代码来源:village_info.aspx.cs


示例7: ibAdd_Click

        protected void ibAdd_Click(object sender, ImageClickEventArgs e)
        {
            GridViewRow gvr = ((GridViewRow)(((ImageButton)(sender)).NamingContainer));
            string name = ((TextBox)gvr.FindControl("txtName")).Text;
            int districtId = Convert.ToInt32(((DropDownList)gvr.FindControl("ddlDistrict")).SelectedValue);
            int tehsilId = Convert.ToInt32(((DropDownList)gvr.FindControl("ddlTehsil")).SelectedValue);

            Village fd = new Village();

            fd.VillageName = name;
            fd.TehsilId = tehsilId;

            try
            {
                vMethods.Add(fd);
                BindGrid();
                js.ShowAlert(this, "Village created succesfully!");
            }
            catch (Exception ex)
            {
                if (ex.InnerException.InnerException.Message.Contains("UNIQUE"))
                {
                    js.ShowAlert(this, "Village already exists! Please try another name.");
                }
                else
                {
                    js.ShowAlert(this, ex.Message);
                }
            }
        }
开发者ID:saif859,项目名称:MAPS,代码行数:30,代码来源:VillageMaster.aspx.cs


示例8: Brothel

 public Brothel(Village v)
     : base(v)
 {
     Name = "Maison Close";
     Hp = MaxHp = 50;
     this.CostPrice = 300;
 }
开发者ID:EmilieS,项目名称:Gleipnir,代码行数:7,代码来源:Brothel.cs


示例9: ReportTableRow

        public ReportTableRow(Village village, Report report)
        {
            _report = report;
            if (village == report.Defender.Village)
            {
                _village = report.Defender.Village;
                _villageOther = report.Attacker.Village;
            }
            else
            {
                _village = report.Attacker.Village;
                _villageOther = report.Defender.Village;
            }

            Cells.Add(new Cell(string.Empty, Report.GetCircleImage(report)));
            Cells.Add(new Cell(string.Empty, Report.GetInfoImage(report)));
            Cells.Add(new Cell(_village.LocationString));
            if (_village.HasPlayer)
            {
                Cells.Add(new Cell(_village.Player.Name));
            }
            else
            {
                Cells.Add(new Cell());
            }
            Cells.Add(new Cell(report.Date));
        }
开发者ID:kindam,项目名称:TWTactics,代码行数:27,代码来源:ReportTableRow.cs


示例10: GetEntity

 internal Village GetEntity()
 {
     Village v = new Village { Name = name, Confidence = 0 };
     v.Id = id;
     v.Position = new Location(x, y);
     return v;
 }
开发者ID:stolwi,项目名称:kingdoms,代码行数:7,代码来源:VillageModel.cs


示例11: Start

	void Start ()
	{
		rank = UnitRank.Peasant;
		CurrentTile = transform.GetComponentInParent<Tile>();

		// This will find the village associated with this peasant, which will be the variable home.
		PathFind = transform.gameObject.GetComponentInParent<PathFinding>();
		List<Tile> tiles = PathFind.GetTiles(CurrentTile);
		
		foreach (Tile t in tiles)
		{
			if (t.HasVillage)
			{
				Home = t.Village.transform.GetComponent<Village>();
			}
		}

		_neutral = false;
		_home = false;
		_enemy = false;
		_water = false;

		CurrentTile.HasPeasant = true;
		
		Glow = transform.FindChild("Glow").gameObject;
//		Box = transform.FindChild("IsBusy").gameObject;

		Box.SetActive(false);
	}
开发者ID:EmilioF,项目名称:UnityProjects,代码行数:29,代码来源:Peasant.cs


示例12: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        this.Village = ((inPage)(this.Master)).CurrentVillage;
        if (this.Village[BuildingType.Academy] > 0)
            this.pConstructed.Visible = true;
        else
            this.pNotConstruct.Visible = true;

        switch (Request["page"])
        {
            case "create":
                CreateHero pCreateHero = (CreateHero)Page.LoadControl(@"CreateHero.ascx");
                pCreateHero.Village = this.Village;
                this.tblMenu.Rows[1].Cells[0].Attributes.Add("class", "selected");
                this.heroPanel.Controls.Add(pCreateHero);
                break;
            case "details":
                HeroDetails pHeroDetails = (HeroDetails)Page.LoadControl(@"HeroDetails.ascx");
                pHeroDetails.Village = this.Village;
                this.tblMenu.Rows[0].Cells[0].Attributes.Add("class", "selected");
                this.heroPanel.Controls.Add(pHeroDetails);
                break;
            default:
                HeroList pHeroList = (HeroList)Page.LoadControl(@"HeroList.ascx");
                pHeroList.Village = this.Village;
                this.tblMenu.Rows[0].Cells[0].Attributes.Add("class", "selected");
                this.heroPanel.Controls.Add(pHeroList);
                break;
        }
    }
开发者ID:DF-thangld,项目名称:web_game,代码行数:30,代码来源:academy.aspx.cs


示例13: Start

	void Start()
	{
		rank = UnitRank.Knight;
		//Debug.Log("Knight Start has been called");
		// Get current tile position
		CurrentTile = transform.GetComponentInParent<Tile>();
		//Debug.Log ("CurrentTile : "+CurrentTile);
		
		
		//this will find the village associated with this Knight, which will be the variable home.
		PathFind = transform.gameObject.GetComponentInParent<PathFinding>();
		List<Tile> tiles = PathFind.GetTiles(CurrentTile);
		//Debug.Log (tiles.Count);
		
		foreach (Tile t in tiles)
		{
			if (t.HasVillage)
			{
				Home = t.Village.transform.GetComponent<Village>();
			}
		}
		
		_neutral = false;
		_home = false;
		_enemy = false;
		_water = false;
		
		// TODO: Test purposes only
		CurrentTile.HasKnight = true;
		//Debug.Log(CurrentTile);
		
		Glow = transform.FindChild("Glow").gameObject;
	}
开发者ID:EmilioF,项目名称:UnityProjects,代码行数:33,代码来源:Knight.cs


示例14: TablePlace

 public TablePlace(Village v)
     : base(v)
 {
     Name = "Autel sacré";
     Hp = MaxHp = 100000;
     this.CostPrice = 0;
 }
开发者ID:EmilieS,项目名称:Gleipnir,代码行数:7,代码来源:TablePlace.cs


示例15: Theater

 public Theater(Village v)
     : base(v)
 {
     Name = "Théâtre";
     Hp = MaxHp = 50;
     this.CostPrice = 650;
 }
开发者ID:EmilieS,项目名称:Gleipnir,代码行数:7,代码来源:Theater.cs


示例16: PartyRoom

 public PartyRoom(Village v)
     : base(v)
 {
     Name = "Salle des Fêtes";
     Hp = MaxHp = 50;
     this.CostPrice = 250;
 }
开发者ID:EmilieS,项目名称:Gleipnir,代码行数:7,代码来源:PartyRoom.cs


示例17: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        inPage p = (inPage)this.Master;
        village = p.CurrentVillage;

        int player_id = 0;
        int.TryParse(Request["player"], out player_id);
        if (player_id == 0)
        {
            this.pUserExists.Visible = false;
            this.pUserNotFound.Visible = true;
            return;
        }

        ISession session = (ISession)Context.Items[Constant.NHibernateSessionSign];
        this.player = session.Get<Player>(player_id);
        

        if (this.player == null)
        {
            this.pUserExists.Visible = false;
            this.pUserNotFound.Visible = true;
            return;
        }

        this.pUserNotFound.Visible = false;
        this.pUserExists.Visible = true;
        this.gvVillages.DataSource = this.player.Villages;
        System.Web.UI.WebControls.HyperLinkField field = (HyperLinkField)this.gvVillages.Columns[0];
        field.DataNavigateUrlFormatString = "village_info.aspx?id=" + this.village.ID.ToString() + "&village={0}";
        this.gvVillages.DataBind();

        this.pSelf.Visible = (this.player.ID == (int)Session["user"]);
    }
开发者ID:DF-thangld,项目名称:web_game,代码行数:34,代码来源:user_info.aspx.cs


示例18: OfferingWarehouse

 public OfferingWarehouse(Village v)
     : base(v)
 {
     Name = "Sanctuaire";
     Hp = MaxHp = 50;
     this.CostPrice = 150;
 }
开发者ID:EmilieS,项目名称:Gleipnir,代码行数:7,代码来源:OfferingWarehouse.cs


示例19: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        current = ((inPage)(this.Master)).CurrentVillage;

        this.NHibernateSession = ((inPage)(this.Master)).NHibernateSession;

        Player currentPlayer = this.NHibernateSession.Load<Player>(Session["user"]);

        this.pSpears.Visible = (this.current.VillageTroopData.SpearInVillage != 0);
        this.pAxe.Visible = (this.current.VillageTroopData.AxeInVillage != 0);
        this.pSword.Visible = (this.current.VillageTroopData.SwordInVillage != 0);
        this.pScout.Visible = (this.current.VillageTroopData.ScoutInVillage != 0);
        this.pLight.Visible = (this.current.VillageTroopData.LightCavalry != 0);
        this.pHeavy.Visible = (this.current.VillageTroopData.HeavyCavalry != 0);
        this.pRam.Visible = (this.current.VillageTroopData.RamInVillage != 0);
        this.pCatapult.Visible = (this.current.VillageTroopData.CatapultInVillage != 0);
        this.pNoble.Visible = (this.current.VillageTroopData.NobleInVillage != 0);

        if (currentPlayer.GraphicalVillage)
        {
            GraphicVillageInfo pGraphicVillageInfo = (GraphicVillageInfo)Page.LoadControl("GraphicVillageInfo.ascx");
            pGraphicVillageInfo.CurrentVillage = current;
            pGraphicVillageInfo.DisplayBuildingLevel = currentPlayer.ShowBuildingLevel;
            this.pVillageInfo.Controls.Add(pGraphicVillageInfo);
            return;
        }
        else
        {
            TextVillageInfo pTextVillageInfo = (TextVillageInfo)Page.LoadControl("TextVillageInfo.ascx");
            pTextVillageInfo.CurrentVillage = current;
            this.pVillageInfo.Controls.Add(pTextVillageInfo);
            return;
        }

    }
开发者ID:DF-thangld,项目名称:web_game,代码行数:35,代码来源:village.aspx.cs


示例20: ShowTime

 /// <summary>
 /// Shows the time in the Distance buttons for the specified villages and speed
 /// </summary>
 public void ShowTime(Village start, Village end, ShowDistanceEnum speed)
 {
     if (start != null && end != null)
     {
         TimeSpan time = Village.TravelTime(start, end, Unit);
         switch (speed)
         {
             case ShowDistanceEnum.ArrivalTime:
                 Text = Tools.Common.GetShortPrettyDate(World.Default.Settings.ServerTime.Add(time));
                 break;
             case ShowDistanceEnum.ReturnTime:
                 Text = Tools.Common.GetShortPrettyDate(World.Default.Settings.ServerTime.Add(time + time));
                 break;
             case ShowDistanceEnum.TravelTime:
                 Text = time.ToString();
                 break;
             case ShowDistanceEnum.TravelTime2:
                 Text = (time + time).ToString();
                 break;
         }
     }
     else
     {
         Text = "";
     }
 }
开发者ID:kindam,项目名称:TWTactics,代码行数:29,代码来源:DistanceControl.cs



注:本文中的Village类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# VimKey类代码示例发布时间:2022-05-24
下一篇:
C# Viewport类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap