本文整理汇总了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");
}
示例2: MazyPrototypeFactory
public MazyPrototypeFactory(Maze maze, Wall wall, Room room, Door door)
{
_maze = maze;
_wall = wall;
_room = room;
_door = door;
}
示例3: Labirynth
public Labirynth(uint x, uint y, GenerationAlghorithm _algorithm)
{
chambersCountHorizontal = x;
chambersCountVertical = y;
walls = new Wall[chambersCountHorizontal, chambersCountVertical];
algorithm = _algorithm;
}
示例4: MazePrototypeFactory
public MazePrototypeFactory(Maze maze, Room room, Door door, Wall wall)
{
this.prototypeMaze = maze;
this.prototypeRoom = room;
this.prototypeDoor = door;
this.prototypeWall = wall;
}
示例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));
}
示例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;
}
示例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);
}
}
示例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();
}
示例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;
}
示例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)
{
}
}
示例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;
}
}
示例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));
}
示例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();
}
示例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;
}
示例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);
}