Clone() public method

Creates a copy of an existing controller.
public Clone ( ) : object
return object
Example #1
0
 public void ChangeMap(Map newMap)
 {
     if (newMap == null)
     {
         throw new ArgumentNullException("newMap");
     }
     lock ( WorldLock ) {
         World newWorld = new World(Name, NeverUnload)
         {
             Map            = newMap,
             AccessSecurity = (SecurityController)AccessSecurity.Clone(),
             BuildSecurity  = (SecurityController)BuildSecurity.Clone(),
             IsHidden       = IsHidden
         };
         newMap.World = newWorld;
         WorldManager.ReplaceWorld(this, newWorld);
         Map = null;
         foreach (Player player in PlayerList)
         {
             player.Session.JoinWorld(newWorld);
         }
     }
 }