本文整理汇总了C#中Village类的典型用法代码示例。如果您正苦于以下问题:C# Village类的具体用法?C# Village怎么用?C# Village使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Village类属于命名空间,在下文中一共展示了Village类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: ChurchInfo
public ChurchInfo(Village village, int churchLevel, Color color)
{
Village = village;
ChurchLevel = churchLevel;
Color = color;
Transparancy = 50;
}
示例3: Baths
public Baths(Village v)
: base(v)
{
Name = "Thermes";
Hp = MaxHp = 50;
this.CostPrice = 500;
}
示例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;
}
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例8: Brothel
public Brothel(Village v)
: base(v)
{
Name = "Maison Close";
Hp = MaxHp = 50;
this.CostPrice = 300;
}
示例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));
}
示例10: GetEntity
internal Village GetEntity()
{
Village v = new Village { Name = name, Confidence = 0 };
v.Id = id;
v.Position = new Location(x, y);
return v;
}
示例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);
}
示例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;
}
}
示例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;
}
示例14: TablePlace
public TablePlace(Village v)
: base(v)
{
Name = "Autel sacré";
Hp = MaxHp = 100000;
this.CostPrice = 0;
}
示例15: Theater
public Theater(Village v)
: base(v)
{
Name = "Théâtre";
Hp = MaxHp = 50;
this.CostPrice = 650;
}