本文整理汇总了C#中fCraft.Map.ResetSpawn方法的典型用法代码示例。如果您正苦于以下问题:C# Map.ResetSpawn方法的具体用法?C# Map.ResetSpawn怎么用?C# Map.ResetSpawn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fCraft.Map
的用法示例。
在下文中一共展示了Map.ResetSpawn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateDefaultMainWorld
static void CreateDefaultMainWorld() {
Map map = new Map( null, 64, 64, 64, true );
MapGenerator.GenerateFlatgrass( map );
map.ResetSpawn();
MainWorld = AddWorld( null, "main", map, true );
}
示例2: AsyncGen
void AsyncGen( object sender, DoWorkEventArgs e ) {
stopwatch = Stopwatch.StartNew();
GC.Collect( GC.MaxGeneration, GCCollectionMode.Forced );
Map generatedMap;
if( tab == Tabs.Generator ) {
MapGenerator gen = new MapGenerator( generatorArgs );
gen.ProgressCallback = delegate( object _sender, ProgressChangedEventArgs args ) {
bwGenerator.ReportProgress( args.ProgressPercentage, args.UserState );
};
generatedMap = gen.Generate();
} else {
generatedMap = new Map( null,
Convert.ToInt32( nFlatgrassDimX.Value ),
Convert.ToInt32( nFlatgrassDimY.Value ),
Convert.ToInt32( nFlatgrassDimH.Value ),
true );
MapGenerator.GenerateFlatgrass( generatedMap );
generatedMap.ResetSpawn();
}
if( floodBarrier ) generatedMap.MakeFloodBarrier();
generatedMap.CalculateShadows();
map = generatedMap;
GC.Collect( GC.MaxGeneration, GCCollectionMode.Forced );
}
示例3: LoadMap
public void LoadMap() {
lock( WorldLock ) {
if( Map != null ) return;
try {
Map = MapUtility.Load( GetMapName() );
} catch( Exception ex ) {
Logger.Log( "World.LoadMap: Failed to load map ({0}): {1}", LogType.Error,
GetMapName(), ex );
}
// or generate a default one
if( Map != null ) {
Map.World = this;
} else {
Logger.Log( "World.LoadMap: Generating default flatgrass level.", LogType.SystemActivity );
Map = new Map( this, 64, 64, 64, true );
MapGenerator.GenerateFlatgrass( Map );
Map.ResetSpawn();
}
StartTasks();
if( OnLoaded != null ) OnLoaded();
}
}