コード例 #1
0
 public void SpawnCoords(int ID, string acttag, int x, int y)
 {
     try {
         var L = KMaps[ID].Layers[Layers[ID]];
         if (L.HasTag(acttag))
         {
             Kill(ID, acttag);
         }
         var A = KthuraActor.Spawn(L, x, y);
         if (A == null)
         {
             throw new Exception($"Cannot spawn actor on coordinate ({x},{y})");
         }
         A.Tag = acttag;
     } catch (Exception DonaldTrump) {
         SBubble.MyError($"<MAP #{ID}>.Actor.{acttag}.Spawn({x},{y}):", DonaldTrump.Message, LuaTrace);
     }
 }
コード例 #2
0
 public void Spawn(int ID, string acttag, string exitpoint)
 {
     try {
         if (!KMaps[ID].Layers.ContainsKey(Layers[ID]))
         {
             throw new Exception($"I cannot contact spawn on non-existent layer {Layers[ID]}");
         }
         var L = KMaps[ID].Layers[Layers[ID]];
         if (L.HasTag(acttag))
         {
             Kill(ID, acttag);
         }
         var A = KthuraActor.Spawn(L, exitpoint);
         if (A == null)
         {
             throw new Exception($"Cannot spawn actor on non-existent spot {exitpoint}");
         }
         A.Tag = acttag;
     } catch (Exception DonaldTrump) {
         SBubble.MyError($"<MAP #{ID}>.Actor.{acttag}.Spawn(\"{exitpoint}\"):", DonaldTrump.Message, LuaTrace);
     }
 }