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

C# BuildingType类代码示例

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

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



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


示例16: Blueprint

    // For a Required Blueprint (like Terraformer, Generator, etc)
    public Blueprint(string Name, TileData.Types _type, BuildingType tType)
    {
        buildingName = Name;
        memoryCost = 0;
        nanoBotCost = 0;
        tileType = _type;
        description = " ";

        buildingType = tType;
    }
开发者ID:cesarrac,项目名称:TheyRise-game,代码行数:11,代码来源:Blueprint.cs


示例17: Building

 public Building(BuildingType type, int level)
 {
     this.Abbreviation = type.Abbreviation;
     this.Category = type.Category;
     this.Height = type.Height;
     this.ID = type.ID;
     this.Name = type.Name;
     this.Width = type.Width;
     this.Level = level;
 }
开发者ID:GuilhermeSa,项目名称:base-builder,代码行数:10,代码来源:Building.cs


示例18: Start

 // Use this for initialization
 void Start()
 {
     buildingList = new Transform[] {cannonBuilding, rocketBuilding, laserBuilding, factoryBuilding, repairBuilding};
     buildingTypeList = new BuildingType[] {BuildingType.Cannon, BuildingType.Rocket, BuildingType.Laser, BuildingType.Factory, BuildingType.Repair};
     for(int i = 0; i < buildingList.Length; i++){
         Transform buildingListObject = (Transform) Transform.Instantiate(buildingList[i], new Vector3(transform.position.x + 1 * i - 2.5F, transform.position.y, transform.position.z), transform.rotation);
         buildingListObject.localScale = new Vector3(1 / Mathf.Sqrt(i + 1), 1 / Mathf.Sqrt(i + 1), 1 / Mathf.Sqrt(i + 1));
         buildingListObject.parent = transform;
     }
     selectedType = buildingTypeList[0];
 }
开发者ID:julianh2o,项目名称:NukeEmFromOrbit,代码行数:12,代码来源:HUDSlot.cs


示例19: ScrollOnSelect

 public void ScrollOnSelect()
 {
     Debug.Log (buildingList[0].name);
     buildingList = new Transform[] {buildingList[1], buildingList[2], buildingList[3], buildingList[4], buildingList[0]};
     buildingTypeList = new BuildingType[] {buildingTypeList[1], buildingTypeList[2], buildingTypeList[3], buildingTypeList[4], buildingTypeList[0]};
     for(int i = 0; i < buildingList.Length; i++){
         buildingList[i].position = new Vector3(transform.position.x + 1 * i - 2.5F, transform.position.y, transform.position.z);
         buildingList[i].localScale = new Vector3(1 / Mathf.Sqrt(i + 1), 1 / Mathf.Sqrt(i + 1), 1 / Mathf.Sqrt(i + 1));
     }
     selectedType = buildingTypeList[0];
 }
开发者ID:julianh2o,项目名称:NukeEmFromOrbit,代码行数:11,代码来源:HUDSlot.cs


示例20: getBuilding

 public Building getBuilding(BuildingType buildingType)
 {
     foreach(Building item in this.BuildingList)
     {
         if(item.BuildingType == buildingType)
         {
             return item;
         }
     }
     return null;
 }
开发者ID:TerisseNicolas,项目名称:Archip3l-WPF,代码行数:11,代码来源:BuildingManager.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# BuiltInParameter类代码示例发布时间:2022-05-24
下一篇:
C# BuildingBlock类代码示例发布时间: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