本文整理汇总了C#中Place类的典型用法代码示例。如果您正苦于以下问题:C# Place类的具体用法?C# Place怎么用?C# Place使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Place类属于命名空间,在下文中一共展示了Place类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
_MapView = new MapView(new RectangleF(0, 0, View.Frame.Width, View.Frame.Height));
_MapView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
View.AddSubview(_MapView);
var home = new Place()
{
Name = "Home",
Description = "Boring Home Town",
Latitude = 32.725410,
Longitude = -97.320840,
};
var office = new Place()
{
Name = "Austin",
Description = "Super Awesome Town",
Latitude = 30.26710,
Longitude = -97.744546,
};
_MapView.ShowRouteFrom(office, home);
}
示例2: MobilityRequired
public override decimal MobilityRequired( Place place )
{
if ( place.Owner == this.Owner )//在自己的领土上移动不需要移动力
return 0;
return base.MobilityRequired( place );
}
示例3: doBFS
List<Place> doBFS(Place pathTarget)
{
Queue<Place> BFSQueue = new Queue<Place> ();
BFSQueue.Enqueue (currentPlace);
currentPlace.visited = true;
Debug.Log ("Start point: " + currentPlace.placeName);
while (BFSQueue.Count != 0) {
Place cur = BFSQueue.Dequeue();
Debug.Log ("Current place: " + cur.placeName);
if(cur.placeName.Equals (pathTarget.placeName)){
Debug.Log ("Done!");
return retracePath(cur);
}
for (int i = 0; i < cur.adjacencies.Length; i++){
if (!cur.adjacencies[i].visited) {
cur.adjacencies[i].visited = true;
cur.adjacencies[i].prevPlace = cur;
BFSQueue.Enqueue (cur.adjacencies[i]);
Debug.Log (" Neighbor of current place (being enqueued now): "+cur.adjacencies[i].placeName);
}
}
}
Debug.Log ("NO PATH FOUND - ERROR");
return null;
}
示例4: Map
public Map(XmlElement map)
{
Row = int.Parse(map.GetAttribute("row"));
Col = int.Parse(map.GetAttribute("col"));
Places = new Place[Row, Col];
PlaceIdToCoordinate = new Dictionary<int, Tuple<int, int>>();
_MaxId = 0;
for (int r = 0; r < Row; r++)
{
for (int c = 0; c < Col; c++)
{
Places[r, c] = new None(0);
}
}
foreach (XmlNode item in map.ChildNodes)
{
int r = int.Parse((item as XmlElement).GetAttribute("row"));
int c = int.Parse((item as XmlElement).GetAttribute("col"));
int id = int.Parse((item as XmlElement).GetAttribute("id"));
NewInstanceFromXml(item, ref Places[r, c], id);
PlaceIdToCoordinate.Add(id, new Tuple<int, int>(r, c));
if (id > _MaxId)
{
_MaxId = id;
}
}
}
示例5: CreateNewInstance
public static PlaceReviewsFragment CreateNewInstance(Place place)
{
return new PlaceReviewsFragment {
Place = place,
Arguments = new Bundle ()
};
}
示例6: CreateDay
internal virtual Day CreateDay()
{
// TODO: Instantiate an appropriate concrete class.
int[] click = {700,1000};
Place hq = new Place(0.0, 0.0, "HQ", click);
Day target = new Future(1, hq);
return target;
}
示例7: NewInstanceFromXml
internal static void NewInstanceFromXml(XmlNode detail, ref Place result, int id)
{
if (detail.Name != "Bank")
{
return;
}
result = new Bank(id);
}
示例8: SPlaceExtended
public SPlaceExtended(HttpContextBase context, Place place, Culture culture = Culture.En)
: base(context, place, culture)
{
Type = PlaceTypes.GetPlaceType(place.TypeId).GetName(culture);
Description = place.GetDescription(culture);
RegionId = place.RegionId;
RegionName = place.Region.GetName(culture);
}
示例9: WhenSavingItShouldDelegateToMongoAbstraction
public void WhenSavingItShouldDelegateToMongoAbstraction()
{
var place = new Place("fooBarBazQuux");
_allPlaces.Save(place);
_mongoDB.Verify(it => it.Save("places", place));
}
示例10: UpdatePlaceInfo
public void UpdatePlaceInfo(Place place)
{
Log("Begin updating Place in database. Place object", place);
DatabaseConnector.PushCommandToDatabase(sqlConnection, CommandList.Build_UpdatePlaceCommand(place));
Log("End updating Place in database. Place object", place);
}
示例11: Day
public Day(int _number, Place _map_hq)
{
number = _number;
map_hq = _map_hq;
l_activity = new List<Activity>();
createDfaultActList();
sortActivityList();
}
示例12: Activity
public Activity(int _start, int _end, Place _place, string _type = "private")
{
//choose the place in a list / with the map. If it's not there, create it
start = _start;
end = _end;
place = _place;
type = _type;
}
示例13: GetID
public int GetID(string country, string city, string street, int house, int flat)
{
Place place = new Place {city = city, country = country, house = house, street = street, flat = flat};
if (!pr.Exist(place.idPlace)) {
pr.Add(place);
}
return pr.GetId(place);
}
示例14: CreatePlace
public void CreatePlace(Place place)
{
Log("Begin creating Place in database. Place object", place);
DatabaseConnector.PushCommandToDatabase(sqlConnection, CommandList.Build_CreatePlaceCommand(place));
Log("End creating Place in database. Place object", place);
}
示例15: GetPlacesFromMongoPlaces
private Place GetPlacesFromMongoPlaces(MongoPlace mongoPlace)
{
var place = new Place();
place.PlaceId = mongoPlace.Id;
place.Name = mongoPlace.Name;
return place;
}