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


C# Room.GetHeight方法代码示例

本文整理汇总了C#中Room.GetHeight方法的典型用法代码示例。如果您正苦于以下问题:C# Room.GetHeight方法的具体用法?C# Room.GetHeight怎么用?C# Room.GetHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Room的用法示例。


在下文中一共展示了Room.GetHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddRoom

    public void AddRoom(Room room)
    {
        Rooms.Add (room);
        int x = room.GetX ();
        int y = room.GetY ();
        int w = room.GetWidth ();
        int h = room.GetHeight ();

        for (int i = y; i < y+h; i++) {
            for(int j = x; j < x+w; j++) tiles[i, j] = true;
        }
    }
开发者ID:olemstrom,项目名称:the-morko,代码行数:12,代码来源:Map.cs

示例2: MarkRoom

 private void MarkRoom(Room r, int newstate)
 {
     for (int i = r.GetX(); i < r.GetX() + r.GetWidth(); i++) {
         for(int j = r.GetY(); j < r.GetY() + r.GetHeight(); j++) {
             tiles[j, i] = newstate;
         }
     }
 }
开发者ID:olemstrom,项目名称:the-morko,代码行数:8,代码来源:PathGenerator.cs

示例3: IsInside

    public bool IsInside(Room r, Vertex2 point)
    {
        int rx = r.GetX ();
        int ry = r.GetY ();
        int rw = r.GetWidth ();
        int rh = r.GetHeight ();

        bool isx = point.x >= rx && point.x <= rx + rw;
        bool isy = point.y >= ry && point.y < ry + rh;

        return isx && isy;
    }
开发者ID:olemstrom,项目名称:the-morko,代码行数:12,代码来源:Map.cs

示例4: Overlaps

    public bool Overlaps(Room room, int buffer)
    {
        bool overlaps = false;

        foreach (Room other in Rooms) {
            bool overlapsX = room.GetX() < other.GetX() + other.GetWidth() + buffer
                             && room.GetX() + room.GetWidth() + buffer > other.GetX();
            bool overlapsY = room.GetY() < other.GetY() + other.GetHeight() + buffer
                             && room.GetY() + room.GetHeight() + buffer > other.GetY();

            if(!overlaps) overlaps = overlapsX && overlapsY;
        }

        return overlaps;
    }
开发者ID:olemstrom,项目名称:the-morko,代码行数:15,代码来源:Map.cs


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