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


C# Wall类代码示例

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


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


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