What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

how to plant in polygon?

fritsjan

New Member
Joined
Oct 4, 2013
Messages
101
Reaction score
0
Hey guys, i am stuck on how to plant stuff in a polygon. Can somebody point me in the right direction. I know that i need a PolygonZone however how do i load a polygon in this PolygonZone.

Greetings
 
hey guys, I put some code together and got it working. Dont know if it is correct, but that doesnt really matter since it works :). Here is the code:

public void test()
{
gps = new Gps(this);
gps.LoadDataBase("C:\\Users\\henk\\Desktop\\archebuddy\\polygontest.db3");
List<GpsPolygon> overviews= gps.GetAllGpsPolygons();

foreach(GpsPolygon overview in overviews)
{

if (overview.name == "aap")
{
List<GpsPoint> points1 = overview.points;
List<ZonePoint> temp = new List<ZonePoint>();
foreach(GpsPoint point in points1)
{
ZonePoint meuk = new ZonePoint();
meuk.x = point.x;
meuk.y = point.y;
temp.Add(meuk);

}
foreach(ZonePoint tem in temp)
{
Log(tem.x.ToString()+" "+tem.y.ToString());

}
PolygonZone final = new PolygonZone(temp);
PlantItemsInZone(seedchoice, final);
}


}


}
 
Back
Top