本文整理汇总了C#中Point3D类的典型用法代码示例。如果您正苦于以下问题:C# Point3D类的具体用法?C# Point3D怎么用?C# Point3D使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Point3D类属于命名空间,在下文中一共展示了Point3D类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 1:
{
m_House = reader.ReadItem() as BaseHouse;
goto case 0;
}
case 0:
{
m_Description = reader.ReadString();
m_Marked = reader.ReadBool();
m_Target = reader.ReadPoint3D();
m_TargetMap = reader.ReadMap();
CalculateHue();
break;
}
}
}
示例2: LocationStruct
public LocationStruct(GenericReader reader)
{
int version = reader.ReadInt();
Map = reader.ReadMap();
Location = reader.ReadPoint3D();
Name = reader.ReadString();
}
示例3: OnDragDropInto
public override bool OnDragDropInto( Mobile from, Item dropped, Point3D point )
{
BasePiece piece = dropped as BasePiece;
if ( piece != null && piece.Board == this && base.OnDragDropInto( from, dropped, point ) )
{
Packet p = new PlaySound( 0x127, GetWorldLocation() );
p.Acquire();
if ( RootParent == from )
{
from.Send( p );
}
else
{
foreach ( NetState state in this.GetClientsInRange( 2 ) )
state.Send( p );
}
p.Release();
return true;
}
else
{
return false;
}
}
示例4: Main
static void Main()
{
//Initializing points
Point3D a = new Point3D(-7,-4, 3);
Point3D b = new Point3D(17, 6, 2.5);
//Print points and distance between them
Console.WriteLine("the distance between point {0} and point {1} is {2}", a,b,DistanceCalculator.Calculate(a,b));
//Print the static start point
Console.WriteLine("Start Point is:{0}",Point3D.Start.ToString());
//Load path from file
Path path = PathStorage.Load("../../points.txt");
for (int i = 0; i < path.Count; i++ )
{
Console.WriteLine("Point {0}: {1}", i, path[i].ToString());
}
//Save new point to file
PathStorage.Save("../../points.txt", new Point3D(9, 9, 9));
Console.WriteLine("List after adding a new point {9,9,9}:");
Path newPath = PathStorage.Load("../../points.txt");
for (int i = 0; i < newPath.Count; i++)
{
Console.WriteLine("Point {0}: {1}", i, newPath[i].ToString());
}
}
示例5: CalcDistance
public static double CalcDistance(Point3D pointOne, Point3D pointTwo)
{
double distance = 0;
distance = Math.Sqrt(Math.Pow(pointOne.pointX - pointTwo.pointX, 2) + Math.Pow(pointOne.pointY - pointTwo.pointY, 2) + Math.Pow(pointOne.pointZ - pointTwo.pointZ, 2));
return distance;
}
示例6: Effect
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005570 ); // You can not gate to another facet.
}
else if ( !map.CanFit( loc.X, loc.Y, loc.Z, 16 ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( !SpellHelper.CheckTravel( Caster, loc, map, TravelType.Gate ) && Caster.AccessLevel == AccessLevel.Player )
{
Caster.PlaySound( 0x5C );
}
else if ( CheckSequence() )
{
Caster.SendLocalizedMessage( 501024 ); // You open a magical gate to another location
Effects.PlaySound( Caster.Location, Caster.Map, 0x20E );
InternalItem firstGate = new InternalItem( loc, map );
firstGate.MoveToWorld( Caster.Location, Caster.Map );
Effects.PlaySound( loc, map, 0x20E );
InternalItem secondGate = new InternalItem( Caster.Location, Caster.Map );
secondGate.MoveToWorld( loc, map );
}
FinishSequence();
}
示例7: DropToMobile
public override bool DropToMobile( Mobile from, Mobile target, Point3D p )
{
bool ret = base.DropToMobile( from, target, p );
if ( ret && !Accepted && Parent != from.Backpack )
{
if ( from.AccessLevel > AccessLevel.Player )
{
return true;
}
else if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
{
return true;
}
else
{
from.SendLocalizedMessage( 1049344 ); // You decide against trading the item. You still need it for your quest.
return false;
}
}
else
{
return ret;
}
}
示例8: LoadPointCoordinates
public static Path3D LoadPointCoordinates(string path)
{
Path3D points = new Path3D();
using (var fileSource = new StreamReader(path, Encoding.UTF8))
{
string line = fileSource.ReadLine();
while (line != null)
{
int[] pointCordinates = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).
Select(int.Parse).ToArray();
if (pointCordinates.Length != 3)
{
throw new ArgumentException();
}
Point3D point = new Point3D(pointCordinates[0], pointCordinates[1], pointCordinates[2]);
points.AddPoints(point);
line = Console.ReadLine();
}
}
return points;
}
示例9: LoadPaths
public static Path3D LoadPaths(string fileName)
{
try
{
string input = File.ReadAllText(fileName);
string pattern = @"X=(.+?), Y=(.+?), Z=(.+?)";
var reg = new Regex(pattern);
var matchs = reg.Matches(input);
Path3D path = new Path3D();
foreach (Match match in matchs)
{
double x = double.Parse(match.Groups[1].Value);
double y = double.Parse(match.Groups[2].Value);
double z = double.Parse(match.Groups[3].Value);
Point3D point = new Point3D(x, y, z);
path.AddPoint(point);
}
return path;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
throw ex.InnerException;
}
}
示例10: Target
public void Target( IPoint3D p )
{
if ( !Caster.CanSee( p ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckSequence() )
{
SpellHelper.Turn( Caster, p );
SpellHelper.GetSurfaceTop( ref p );
Effects.PlaySound( p, Caster.Map, 0x382 );
Point3D loc = new Point3D( p.X, p.Y, p.Z );
Item item = new InternalItem( loc, Caster.Map, Caster );
}
FinishSequence();
}
示例11: BeginLaunch
public void BeginLaunch( Mobile from, bool useCharges )
{
Map map = from.Map;
if ( map == null || map == Map.Internal )
return;
if ( useCharges )
{
if ( Charges > 0 )
{
--Charges;
}
else
{
from.SendLocalizedMessage( 502412 ); // There are no charges left on that item.
return;
}
}
from.SendLocalizedMessage( 502615 ); // You launch a firework!
Point3D ourLoc = GetWorldLocation();
Point3D startLoc = new Point3D( ourLoc.X, ourLoc.Y, ourLoc.Z + 10 );
Point3D endLoc = new Point3D( startLoc.X + Utility.RandomMinMax( -2, 2 ), startLoc.Y + Utility.RandomMinMax( -2, 2 ), startLoc.Z + 32 );
Effects.SendMovingEffect( new Entity( Serial.Zero, startLoc, map ), new Entity( Serial.Zero, endLoc, map ),
0x36E4, 5, 0, false, false );
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( FinishLaunch ), new object[]{ from, endLoc, map } );
}
示例12: OnMovement
public override void OnMovement(Mobile m, Point3D oldLocation)
{
base.OnMovement(m, oldLocation);
Tournament tourny = null;
if (this.m_Tournament != null)
tourny = this.m_Tournament.Tournament;
if (this.InRange(m, 4) && !this.InRange(oldLocation, 4) && tourny != null && tourny.Stage == TournamentStage.Signup && m.CanBeginAction(this))
{
Ladder ladder = Ladder.Instance;
if (ladder != null)
{
LadderEntry entry = ladder.Find(m);
if (entry != null && Ladder.GetLevel(entry.Experience) < tourny.LevelRequirement)
return;
}
if (tourny.HasParticipant(m))
return;
this.PrivateOverheadMessage(MessageType.Regular, 0x35, false, String.Format("Hello m'{0}. Dost thou wish to enter this tournament? You need only to write your name in this book.", m.Female ? "Lady" : "Lord"), m.NetState);
m.BeginAction(this);
Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerStateCallback(ReleaseLock_Callback), m);
}
}
示例13: OnMoveInto
public override bool OnMoveInto(Mobile m, Direction d, Point3D newLocation, Point3D oldLocation)
{
if (m.Player && Factions.Sigil.ExistsOn(m))
{
m.SendMessage(0x22, "You are holding a sigil and cannot enter this zone.");
return false;
}
PlayerMobile pm = m as PlayerMobile;
if (pm == null && m is BaseCreature)
{
BaseCreature bc = (BaseCreature)m;
if (bc.Summoned)
pm = bc.SummonMaster as PlayerMobile;
}
if (pm != null && pm.DuelContext != null && pm.DuelContext.StartedBeginCountdown)
return true;
if (DuelContext.CheckCombat(m))
{
m.SendMessage(0x22, "You have recently been in combat and cannot enter this zone.");
return false;
}
return base.OnMoveInto(m, d, newLocation, oldLocation);
}
示例14: AllowHousing
public override bool AllowHousing(Mobile from, Point3D p)
{
if (from.AccessLevel < AccessLevel.GameMaster)
return false;
return base.AllowHousing(from, p);
}
示例15: SignEntry
public SignEntry( string text, Point3D pt, int itemID, int mapLoc )
{
m_Text = text;
m_Location = pt;
m_ItemID = itemID;
m_Map = mapLoc;
}