当前位置: 首页>>代码示例>>C#>>正文


C# BuildingType类代码示例

本文整理汇总了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();
        }
开发者ID:TerisseNicolas,项目名称:Archip3l-WPF,代码行数:33,代码来源:Building.cs

示例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;
 }
开发者ID:Sessional,项目名称:Tower-Defense-Project,代码行数:8,代码来源:Building.cs

示例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;
    }
开发者ID:NeonPandaSp,项目名称:ValenceGame,代码行数:8,代码来源:BuildingScript.cs

示例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];
 }
开发者ID:BackupTheBerlios,项目名称:wc3o-svn,代码行数:8,代码来源:BuildingInfo.cs

示例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);
    }
开发者ID:albmarvil,项目名称:DFT,代码行数:13,代码来源:BuildHUDController.cs

示例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;
        }
开发者ID:nattress,项目名称:simcity-minecraft,代码行数:58,代码来源:BuildingSource.cs

示例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);
    }
开发者ID:jlvermeulen,项目名称:bunka,代码行数:9,代码来源:ConstructionHandler.cs

示例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);
        }
开发者ID:Brontsy,项目名称:Kingdom,代码行数:9,代码来源:BuildingService.cs

示例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();
     }
 }
开发者ID:tah182,项目名称:Comet,代码行数:14,代码来源:LocationFactory.cs

示例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;
 }
开发者ID:Kahval,项目名称:TravianBot,代码行数:16,代码来源:Building.cs

示例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);
    }
开发者ID:Lukasz199312,项目名称:ClickCraft,代码行数:9,代码来源:TMP_CreateBuilding.cs

示例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;
 }
开发者ID:jlvermeulen,项目名称:bunka,代码行数:10,代码来源:BuildingLoader.cs

示例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;
 }
开发者ID:nathn123,项目名称:Ai-RTS-Game,代码行数:9,代码来源:Building.cs

示例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>();
 }
开发者ID:Sessional,项目名称:Tower-Defense-Project,代码行数:9,代码来源:Tower.cs

示例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;
 }
开发者ID:Kahval,项目名称:TravianBot,代码行数:16,代码来源:BuildingData.cs


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