コード例 #1
0
        public static MapCell GetCellByCellId(this Worlds.World world, string s2CellId)
        {
            MapCell reslt;

            Worlds.World.Cells.TryGetValue(s2CellId, out reslt);
            return(reslt);
        }
コード例 #2
0
ファイル: SmallFireball.cs プロジェクト: lvyitian/Alex
        /// <inheritdoc />
        public SmallFireball(Worlds.World level) : base(EntityType.SmallFireball, level)
        {
            Width   = 0.3125;
            Height  = 0.3125;
            Gravity = 0;

            if (ItemFactory.TryGetItem("minecraft:fire_charge", out var item))
            {
                SetItem(item);
            }
        }
コード例 #3
0
        public static bool AddNewCell(this Worlds.World world, MapCell newCell, bool force)
        {
            bool reslt;

            if (force)
            {
                reslt = Worlds.World.Cells.AddOrUpdate(newCell.S2CellId.ToString(), newCell, (k, v) => newCell) != null;
            }
            else
            {
                reslt = Worlds.World.Cells.TryAdd(newCell.S2CellId.ToString(), newCell);
            }
            return(reslt);
        }
コード例 #4
0
        public static void RefreshSpawns(this Worlds.World world, string s2CellId = null)
        {
            var s2CellIds = Worlds.World.Cells.GetEnumerator();

            do
            {
                if (s2CellIds.Current.Value.IsNull())
                {
                    continue;
                }

                if (s2CellId != null)
                {
                    while (s2CellId != s2CellIds.Current.Key)
                    {
                        s2CellIds.MoveNext();
                    }
                }
                KeyValuePair <string, MapCell> currCell = s2CellIds.Current;
                foreach (var fort in currCell.Value.Forts)
                {
                }
            } while (s2CellIds.MoveNext() && s2CellId == null);
        }
コード例 #5
0
 public TileDamageEvent(Player player, byte damage, Tile tile, Worlds.World world, API.Server server) : base(tile, world, server)
 {
     Player = player;
     Damage = damage;
 }
コード例 #6
0
 public WorldWireOperationEvent(Vector2D <int> start, Vector2D <int> end, WireToolMode mode, Player player, API.Server server, Worlds.World world) : base(server, world)
 {
     Start  = start;
     End    = end;
     Mode   = mode;
     Source = player;
 }
コード例 #7
0
 public static bool CellAlreadyRegistered(this Worlds.World world, string s2CellId)
 {
     return(Worlds.World.Cells.ContainsKey(s2CellId));
 }
コード例 #8
0
 public static int GetCellIndexByCellId(this Worlds.World world, string s2CellId)
 {
     return(0);
 }
コード例 #9
0
 public TileBreakEvent(Player player, Tile tile, Worlds.World world, API.Server server) : base(tile, world, server)
 {
     Player = player;
 }
コード例 #10
0
 protected TileEvent(Tile tile, Worlds.World world, API.Server server) : base(server, world)
 {
     Tile = tile;
 }