本文整理汇总了C#中BuildingType类的典型用法代码示例。如果您正苦于以下问题:C# BuildingType类的具体用法?C# BuildingType怎么用?C# BuildingType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildingType类属于命名空间,在下文中一共展示了BuildingType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Building
public Building(BuildingType buildingType, Island island)
{
this.BuildingType = buildingType;
this.ResourceManager = new ResourceManager();
this.BuildState = 0;
this.Island = island;
this.ConstructionResourceNeeded = new List<Tuple<ResourceType, int>>();
this.Name = String.Empty;
switch (buildingType)
{
case BuildingType.Scierie:
this.ConstructionResourceNeeded.Add(new Tuple<ResourceType, int>(ResourceType.Or, 3));
this.ResourceManager.addResource(ResourceType.Bois, "bois", 0, 4);
//ressourceNeeded = "or";
//consumptionCost = 3;
//ressourceProduced = "bois";
//productionCost = 4;
this.ConstructionTime = 5;
break;
case BuildingType.Mine:
this.ResourceManager.addResource(ResourceType.Or, "Or", 0, 1);
this.ConstructionTime = 0;
break;
case BuildingType.Usine:
this.ConstructionTime = 0;
break;
case BuildingType.Ferme:
this.ConstructionTime = 0;
break;
}
//this.build();
}
示例2: Building
public Building(TowerDefenseGame masterGame, ContentManager content, GameTile parentTile, BuildingType type, Texture2D image)
{
this.masterGame = masterGame;
this.content = content;
this.tile = parentTile;
this.type = type;
this.buildingTexture = image;
}
示例3: initBuildingType
public void initBuildingType()
{
//Create a new buildingtype and pass the type of building, the area of that building, the number of similar building, and the number of agents currently working at that building type
bType = new BuildingType (myType, myArea);
//bType.farmerVal = _myGameController.farmerList.Count;
//bType.farmVal = _myGameController.farmBuildingList.Count;
}
示例4: Get
public static BuildingInfo Get(BuildingType t)
{
if (infos == null)
infos = new SortedDictionary<BuildingType, BuildingInfo>();
if (!infos.ContainsKey(t))
Create(t);
return infos[t];
}
示例5: SelectBuilding
/// <summary>
/// Method used to communicate with the game logic and draw some feedback about the building chosen.
/// It will call BuilderManager to change the logic and highlight the correct option
/// </summary>
/// <param name="type">Type of building chosen</param>
public void SelectBuilding(BuildingType type)
{
Vector3 pos = m_BuildingButtons[(int)type].GetComponent<Transform>().position;
m_Highlight.GetComponent<Transform>().position = pos;
BuilderManager.Singleton.SelectBuilding(type);
}
示例6: BuildingBlocks
public BuildingBlocks(AnvilWorld world, ModelData md, BuildingType buildingType)
{
BlockManager bm = world.GetBlockManager();
ModelDataModel mdm = md.GetModelByTypeId((int)buildingType);
if (mdm == null)
{
// This can happen until we have models for everything in the config file
Height = 0;
GroundLevelOffset = 0;
return;
}
GroundLevelOffset = mdm.GroundLevelOffset;
IntVector3 corner1 = new IntVector3();
corner1.X = mdm.Corner1[0].x;
corner1.Y = mdm.Corner1[0].y;
corner1.Z = mdm.Corner1[0].z;
IntVector3 corner2 = new IntVector3();
corner2.X = mdm.Corner2[0].x;
corner2.Y = mdm.Corner2[0].y;
corner2.Z = mdm.Corner2[0].z;
// Handle rotation
/*
* Block entities aren't drawing right. We're flipping the Z-axis here which might be the cause..
*
blocks = new AlphaBlock[Math.Abs(corner1.X - corner2.X) + 1, Math.Abs(corner1.Y - corner2.Y) + 1, Math.Abs(corner1.Z - corner2.Z) + 1];
for (int x = corner1.X; x <= corner2.X; x++)
{
for (int y = corner1.Y; y <= corner2.Y; y++)
{
for (int z = 0; z <= Math.Abs(corner2.Z - corner1.Z); z++)
{
blocks[x - corner1.X, y - corner1.Y, z] = bm.GetBlock(x, y, corner2.Z - z);
}
}
}
*/
blocks = new AlphaBlock[Math.Abs(corner1.X - corner2.X) + 1, Math.Abs(corner1.Y - corner2.Y) + 1, Math.Abs(corner1.Z - corner2.Z) + 1];
for (int x = corner1.X; x <= corner2.X; x++)
{
for (int y = corner1.Y; y <= corner2.Y; y++)
{
for (int z = corner1.Z; z <= corner2.Z; z++)
{
blocks[x - corner1.X, y - corner1.Y, z - corner1.Z] = bm.GetBlock(x, y, z);
}
}
}
Height = Math.Abs(corner1.Y - corner2.Y) + 1;
}
示例7: ConstructionHandler
public ConstructionHandler(BuildingType type, ResourceType[] costTypes, uint[] costAmounts, float constructionTime, CPoint position)
{
this.Location = new ConstructionBuilding(this, costTypes, costAmounts, constructionTime, position);
this.BuildingType = type;
// request required resources
for (int i = 0; i < costTypes.Length; i++)
BunkaGame.ResourceManager.RequestResource(costTypes[i], costAmounts[i], this.Location);
}
示例8: Add
public void Add(int regionId, int x, int y, BuildingType type)
{
IBuilding building = null;// this._buildingRepository.Get(type);
ITile tile = this._tileService.GetTile(regionId, x, y );
tile.AddBuilding(building);
this._tileService.SaveTile(tile);
}
示例9: createBuilding
/// <summary>
/// Returns a Service to retrieve building with network connectivity
/// </summary>
/// <param name="type">The type of buildings to create</param>
/// <returns>A service to create network buildings</returns>
public static IBuildingSvc createBuilding(BuildingType type)
{
switch (type) {
case BuildingType.SDP :
return new BuildingSvcImplDB();
default :
return new BuildingSvcImplDB();
}
}
示例10: Building
/// <summary>
/// Initializes a new instance of the
/// <see cref="Building" /> class.
/// </summary>
/// <param name="id">Building id.</param>
/// <param name="type">Building type.</param>
/// <param name="level">Building level.</param>
public Building(
int id,
BuildingType type = BuildingType.UNKNOWN,
int level = 0)
{
Id = id;
Type = type;
Level = level;
}
示例11: AddBuilding
public void AddBuilding(BuildingType Group)
{
Building newBuilding = Instantiate(BuildingToCreate) as Building;
newBuilding.gameObject.name = BuildingToCreate.name + " - " + (Group.Builds.Count + 1).ToString() ;
newBuilding.gameObject.transform.parent = Group.transform;
newBuilding.gameObject.SetActive(true);
Group.Builds.Add(newBuilding);
}
示例12: CreateBuilding
// create a building object of a specific type
public Building CreateBuilding(BuildingType type, CPoint position)
{
if (type > BuildingType.CONVERSION)
return CreateConversionBuilding(type, position);
else if (type > BuildingType.PRODUCTION)
return CreateProductionBuilding(type, position);
else
return null;
}
示例13: Initialise
public void Initialise(Vector2 Pos,Vector2 Dims, BuildingType Ftype_)
{
Items = new List<Villager.Items>();
Type = BuildingType.buildingSite;
FType = Ftype_;
Position = Pos;
Dimensions = Dims;
IsBuilt = false;
}
示例14: Tower
public Tower(TowerDefenseGame masterGame, ContentManager content, GameTile parentTile, BuildingType type, Texture2D image)
: base(masterGame, content, parentTile, type, image)
{
range = 2;
rateOfFire = 30;
nextFire = 0;
damage = 2;
projectiles = new List<Projectile>();
}
示例15: BuildingData
/// <summary>
/// Initializes a new copy of <see cref="BuildingData"/> struct.
/// </summary>
/// <param name="id">Id value.</param>
/// <param name="type">Structure type.</param>
/// <param name="level">Level value</param>
public BuildingData(
int id,
BuildingType type,
int level)
: this()
{
Id = id;
Type = type;
Level = level;
}