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

C# Wall类代码示例

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

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



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

示例1: ChangeToDoor

 public static void ChangeToDoor(Wall a, Wall b)
 {
     //right and left mode to modify
     if (a.X == b.X)
     {
         if (a.Y < b.Y)
         {
             a.sides.Right = MultiWallScript.Mode.Half;
             b.sides.Left = MultiWallScript.Mode.Half;
         }
         else
         {
             a.sides.Left = MultiWallScript.Mode.Half;
             b.sides.Right = MultiWallScript.Mode.Half;
         }
     }
     //top and bottom mode to modify
     else if (a.Y == b.Y)
     {
         if (a.X < b.X)
         {
             a.sides.Bottom = MultiWallScript.Mode.Half;
             b.sides.Top = MultiWallScript.Mode.Half;
         }
         else
         {
             a.sides.Top = MultiWallScript.Mode.Half;
             b.sides.Bottom = MultiWallScript.Mode.Half;
         }
     }
     else
         throw new System.ArgumentException("Inproper coordinates of the walls");
 }
开发者ID:DormantDreams,项目名称:video-game-level-scanner,代码行数:33,代码来源:Wall.cs


示例2: MazyPrototypeFactory

 public MazyPrototypeFactory(Maze maze, Wall wall, Room room, Door door)
 {
     _maze = maze;
     _wall = wall;
     _room = room;
     _door = door;
 }
开发者ID:trupak,项目名称:DesignPatternsViaC,代码行数:7,代码来源:MazyPrototypeFactory.cs


示例3: Labirynth

 public Labirynth(uint x, uint y, GenerationAlghorithm _algorithm)
 {
     chambersCountHorizontal = x;
     chambersCountVertical = y;
     walls = new Wall[chambersCountHorizontal, chambersCountVertical];
     algorithm = _algorithm;
 }
开发者ID:CybransLoyalist,项目名称:ProjektEdukacyjny,代码行数:7,代码来源:Labirynth.cs


示例4: MazePrototypeFactory

 public MazePrototypeFactory(Maze maze, Room room, Door door, Wall wall)
 {
     this.prototypeMaze = maze;
     this.prototypeRoom = room;
     this.prototypeDoor = door;
     this.prototypeWall = wall;
 }
开发者ID:TheoAndersen,项目名称:GoF.CreationalPatterns,代码行数:7,代码来源:MazePrototypeFactory.cs


示例5: AttackInitialWallTwice

 public void AttackInitialWallTwice()
 {
     Wall wall = new Wall();
     wall.NewDay();
     Assert.IsTrue(wall.Attack(10, 12, 6));
     Assert.IsTrue(wall.Attack(10, 12, 6));
 }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:7,代码来源:WallTests.cs


示例6: GetExteriorWallDirection

        /// <summary>
        /// Obtains the outward direction of the exterior wall.
        /// </summary>
        /// <param name="wall">The wall.</param>
        /// <returns>A normalized XYZ direction vector.</returns>
        protected XYZ GetExteriorWallDirection(Wall wall)
        {
            LocationCurve locationCurve = wall.Location as LocationCurve;
            XYZ exteriorDirection = XYZ.BasisZ;

            if (locationCurve != null)
            {
                Curve curve = locationCurve.Curve;

                //Write("Wall line endpoints: ", curve);

                XYZ direction = XYZ.BasisX;
                if (curve is Line)
                {
                    // Obtains the tangent vector of the wall.
                    direction = curve.ComputeDerivatives(0, true).BasisX.Normalize();
                }
                else
                {
                    // An assumption, for non-linear walls, that the "tangent vector" is the direction
                    // from the start of the wall to the end.
                    direction = (curve.get_EndPoint(1) - curve.get_EndPoint(0)).Normalize();
                }
                // Calculate the normal vector via cross product.
                exteriorDirection = XYZ.BasisZ.CrossProduct(direction);

                // Flipped walls need to reverse the calculated direction
                if (wall.Flipped) exteriorDirection = -exteriorDirection;
            }

            return exteriorDirection;
        }
开发者ID:AMEE,项目名称:revit,代码行数:37,代码来源:FindSouthFacingWalls.cs


示例7: Main

    public static void Main(string[] args)
    {
        System.Console.WriteLine("Starting Tester.");

        System.Console.WriteLine("Writing Hello on wall.");
        Wall wall = new Wall();
        wall.writeBSTROnWall("Hello");
        System.Console.WriteLine("Writing Brrrrr! on wall.");
        wall.writeBSTROnWall("Brrrrr!");
        System.Console.WriteLine("Reading wall:");
        string wallContents = "overwrite me";
        wallContents = wall.readWallBSTR();
        System.Console.WriteLine("Wall says: " + wallContents);
        System.Console.WriteLine("Again, Wall says: '" + wall.readWallBSTR() + "'.");

        System.Console.WriteLine("\n\nDoing Bag-Ball test");
        //TODO What if I create it something like: IBag bag = (IBall) Factory.BagClass();  Eberhard might have said I was supposed to be doing this sort of thing that way.
        Bag bag = new Bag();
        Ball ball = (Ball) bag.ProvideBall(); // TODO what if I cast it as an IBall rather than Ball

        long distance_rolled;
        distance_rolled = ball.roll(2);
        System.Console.WriteLine("Rolling ball by 2. Accumulated distance: {0} (should say 2)", distance_rolled);
        if (distance_rolled != 2) {
            System.Console.WriteLine("Tester.exe: Error, distance wasn't correct. Exiting.");
            Environment.Exit(-1);
        }
        bag.InspectBall(ball);
        distance_rolled = ball.roll(9);
        System.Console.WriteLine("Rolling ball by 9. Accumulated distance: {0} (should say 14)", distance_rolled);
        if (distance_rolled != 14) {
            System.Console.WriteLine("Tester.exe: Error, distance wasn't correct. Exiting.");
            Environment.Exit(-1);
        }
    }
开发者ID:sillsdev,项目名称:libcom,代码行数:35,代码来源:Tester.cs


示例8: Awake

    void Awake()
    {
        justTraveled = 0;
        gameObject.isStatic = true;
        gameObject.transform.localPosition = Vector3.zero;

        GetComponent<BoxCollider>().isTrigger = true;

        wall = transform.parent.GetComponent<Wall>();
        floor = transform.parent.transform.parent.gameObject;
        CBS = Camera.main.GetComponent<PlayerMovement>().CBS;
        playerInteraction = Camera.main.GetComponent<PlayerMovement>();
        
        if (tag == "down" || tag == "back")
        {
            wallSize = wall.xSize;
        }
        else
        {
            wallSize = wall.zSize;
        }

        xSize = 1;
        ySize = 3;
        gridX = wall.xSize;

        Generate();
    }
开发者ID:darkstrauss,项目名称:Bonkers,代码行数:28,代码来源:Door.cs


示例9: WallCatalogResource

 public WallCatalogResource(int APIversion,
     uint version,
     uint unknown2,
     Common common,
     Wall wallType,
     Partition partitionType,
     PartitionFlagsType partitionFlags,
     VerticalSpan verticalSpanType,
     PartitionsBlockedFlagsType partitionsBlockedFlags,
     PartitionsBlockedFlagsType adjacentPartitionsBlockedFlags,
     PartitionTool partitionToolMode,
     ToolUsageFlagsType toolUsageFlags,
     uint defaultPatternIndex,
     WallThickness wallThicknessType,
     TGIBlockList ltgib)
     : base(APIversion, version, common, ltgib)
 {
     this.unknown2 = unknown2;
     this.wallType = wallType;
     this.partitionType = partitionType;
     this.partitionFlags = partitionFlags;
     this.verticalSpanType = verticalSpanType;
     this.partitionsBlockedFlags = partitionsBlockedFlags;
     this.adjacentPartitionsBlockedFlags = adjacentPartitionsBlockedFlags;
     this.partitionToolMode = partitionToolMode;
     this.toolUsageFlags = toolUsageFlags;
     this.defaultPatternIndex = defaultPatternIndex;
     this.wallThicknessType = wallThicknessType;
 }
开发者ID:dd-dk,项目名称:s3pi,代码行数:29,代码来源:WallCatalogResource.cs


示例10: read_from_file

        public void read_from_file(string name, int count_walls)
        {
            StreamReader myStream = null;
            try
            {
                myStream = new StreamReader(name);
                using (myStream)
                {
                    Walls = null;
                    Walls = new List<Wall>();

                    Wall arg;
                    int i = 0;
                    while (i < count_walls)
                    {
                        myStream.BaseStream.ReadByte();
                        arg = new Wall(new Point(myStream.BaseStream.ReadByte(), myStream.BaseStream.ReadByte()), new Point(myStream.BaseStream.ReadByte(), myStream.BaseStream.ReadByte()));
                        if ((arg.Dot_1.X != 0 && arg.Dot_1.Y != 0) || (arg.Dot_2.X != 0 && arg.Dot_2.Y != 0))
                        {
                            Walls.Add(arg);
                            ++i;
                        }
                    }
                }
                myStream.Close();
            }
            catch (Exception)
            {
            }
        }
开发者ID:pashkobohdan,项目名称:Semester_project_2_course,代码行数:30,代码来源:Labyrinth.cs


示例11: FadeOut

    public void FadeOut(Wall notifier = null)
    {
        targetAlpha = fadeAlpha;
        waitFrames = 1;

        if (notifier)
            shouldFadeCompletely = canFadeCompletely && notifier.transform.position.z == transform.position.z;
        else if (canFadeCompletely)
            shouldFadeCompletely = true;

        if (shouldFadeCompletely)
        {
            foreach (Wall neighbour in neighbours)
            {
                if (notifier != neighbour)
                    neighbour.FadeOut(this);
            }
        }
        else if (notifier && (!lastNotifier || notifier.transform.position.x == transform.position.x))
        {
            m.SetVector("_FadePoint", notifier.transform.position + (transform.position - notifier.transform.position) / 2);
            Vector3 axis = (notifier.transform.position - transform.position);
            axis.x = Mathf.Abs(axis.x);
            axis.y = Mathf.Abs(axis.y);
            axis.z = Mathf.Abs(axis.z);
            m.SetVector("_FadeAxis", axis);
            lastNotifier = notifier;
        }
    }
开发者ID:LuciusSixPercent,项目名称:Finsternis,代码行数:29,代码来源:Wall.cs


示例12: AttackInitialWallTwoDaysDifferentPlaces

 public void AttackInitialWallTwoDaysDifferentPlaces()
 {
     Wall wall = new Wall();
     wall.NewDay();
     Assert.IsTrue(wall.Attack(10, 12, 6));
     wall.NewDay();
     Assert.IsTrue(wall.Attack(11, 13, 6));
 }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:8,代码来源:WallTests.cs


示例13: ProfileWall

 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="wall">wall to create reinforcement on</param>
 /// <param name="commandData">object which contains reference to Revit Application</param>
 public ProfileWall(Wall wall, ExternalCommandData commandData)
     : base(commandData)
 {
     m_data = wall;
     List<List<Edge>> faces = GetFaces(m_data);
     m_points = GetNeedPoints(faces);
     m_to2DMatrix = GetTo2DMatrix();
 }
开发者ID:AMEE,项目名称:revit,代码行数:13,代码来源:ProfileWall.cs


示例14: IsNextTo

 public bool IsNextTo(Wall otherWall)
 {
     int diffX = this.X - otherWall.X;
     int diffY = this.Y - otherWall.Y;
     if (diffX == 0 || diffY == 0)
         return (System.Math.Abs(diffX + diffY) == 1);
     return false;
 }
开发者ID:DormantDreams,项目名称:video-game-level-scanner,代码行数:8,代码来源:Wall.cs


示例15: Add_New_Wall

 //丟入牆壁起末點
 public void Add_New_Wall(PointF p1, PointF p2)
 {
     Wall new_wall = new Wall();
     new_wall.start.X = p1.X;
     new_wall.start.Y = p1.Y;
     new_wall.end.X = p2.X;
     new_wall.end.Y = p2.Y;
     Mywall.Add(new_wall);
 }
开发者ID:yuxiang2025,项目名称:CI,代码行数:10,代码来源:Form1.cs


示例16: IsThereAWallAt

 public static bool IsThereAWallAt(int x, int y, Wall[] walls = null)
 {
     if (walls == null)
     {
         // this is dangerous...
         walls = GameObject.FindObjectsOfType<Wall>();
     }
     var match = walls.FirstOrDefault(w => Mathf.RoundToInt(w.transform.position.x) == x && Mathf.RoundToInt(w.transform.position.y) == y);
     return match != null;
 }
开发者ID:PeteJBB,项目名称:SupremeViolence,代码行数:10,代码来源:Wall.cs


示例17: AttackInitialThousandDays

        public void AttackInitialThousandDays()
        {
            Wall wall = new Wall();

            for (int k = 0; k < 1000; k++)
            {
                wall.NewDay();
                Assert.IsTrue(wall.Attack(k, k + 100, 6));
            }
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:10,代码来源:WallTests.cs


示例18: Initialize

 protected override void Initialize()
 {
     Map = new Map();
     Camera = new Camera2D(Vector2.Zero, Map.Width - 800, Map.Height - 600);
     Car = new Car(new Vector2(XNAGame.I.Width / 2 + 50, XNAGame.I.Height / 2 + 50));
     Wall = new Wall(new Vector2(XNAGame.I.Width / 2 + 50, XNAGame.I.Height / 2 + 500), 100, 16);
     info = new Text("", "Speed: 0 - Angle: 0", new Vector2(0, 20));
     Music = new Music("track");
     Music.Play(true);
 }
开发者ID:Dahrkael,项目名称:TopDown-Racer,代码行数:10,代码来源:SceneTest.cs


示例19: Clone

        /**
         * This method returns a copy of the blueprint.
         * This is a Deep Copy, meaning that all the Rooms, Corners in those rooms and Walls connected to those corners will be copied.
         * The purpose of this is to make a new copy to work in when editing a blueprint, while preserving the original.
         */
        public Blueprint Clone()
        {
            Blueprint newBp = new Blueprint(this.Name);

            List<Wall> newWalls = new List<Wall>();
            List<Corner> newCorners = new List<Corner>();

            foreach(Room room in this.Rooms) {
                Room newRoom = new Room(room.Name, room.GetID(), room.GetFloorID(), room.FunctionID);
                newBp.Rooms.Add(newRoom);

                foreach(Corner corner in room.GetCorners()) {
                    Corner newCorner = newCorners.Find( (c) => (c.GetID() == corner.GetID()) );
                    if(newCorner != null) {
                        newRoom.AddCorner(newCorner);
                        continue;
                    }

                    newCorner = new Corner(corner.GetID(), corner.GetPoint());
                    newRoom.AddCorner(newCorner);
                    newCorners.Add(newCorner);

                    foreach(Wall wall in corner.GetWalls()) {
                        Wall newWall = newWalls.Find( (w) => (w.GetID() == wall.GetID()) );
                        if(newWall != null) {
                            if(newWall.Left.GetID() == corner.GetID()) {
                                newWall.Left = newCorner;
                            } else if(newWall.Right.GetID() == corner.GetID()) {
                                newWall.Right = newCorner;
                            }
                            if(newWall.GetType() == typeof(Door)) {
                                ((Door)newWall).Hinge = (((Door)newWall).Hinge.Equals(newWall.Left) ? newWall.Left : newWall.Right);
                            }
                            newCorner.AddWall(newWall);
                            continue;
                        }

                        Corner left = (wall.Left.Equals(newCorner) ? newCorner : wall.Left);
                        Corner right = (wall.Right.Equals(newCorner) ? newCorner : wall.Right);

                        if(wall.GetType() == typeof(Door)) {
                            newWall = new Door(wall.GetID(), left, right, (((Door)wall).Hinge.GetID() == left.GetID() ? left : right), ((Door)wall).Direction);
                        } else {
                            newWall = new Wall(wall.GetID(), left, right);
                        }

                        newWalls.Add(newWall);
                        newCorner.AddWall(newWall);
                    }
                }
                newRoom.IsChanged = room.IsChanged;
            }

            return newBp;
        }
开发者ID:Railec,项目名称:SE1cKBS2,代码行数:60,代码来源:Blueprint.cs


示例20: Map

    public Map(int size)
    {
        // make map size odd so that we can have a center square
        if(size % 2 != 0)
            size = size + 1;

        Width = size;
        Height = size;

        Wall = new Wall(5);
    }
开发者ID:jtuttle,项目名称:haven,代码行数:11,代码来源:Map.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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