Exemplo n.º 1
0
        private static void ReportCantFindCell(Cell_Storage_Collection collection, IntVec3 cell)
        {
            Dictionary <IntVec3, CellStorage> cells = (Dictionary <IntVec3, CellStorage>)_cacheCells.GetValue(collection);
            StringBuilder sb = new StringBuilder();

            foreach (IntVec3 c in cells.Keys)
            {
                sb.Append(c);
            }

            Log.Error($"Cannot find {cell} in storage {sb}");
        }
Exemplo n.º 2
0
        public static bool TestSpareSpaceOnNonFull(this Cell_Storage_Collection collection, Thing thing, IntVec3 cell, int expectedCount)
        {
            if (collection.TryGetCellStorage(cell, out CellStorage cellStorage))
            {
                return(Assert.AreEqaul(
                           cellStorage.SpareSpaceOnNonFull(thing)
                           , expectedCount
                           , $"SpareSpace On {cell}"
                           , nameof(expectedCount)));
            }

            ReportCantFindCell(collection, cell);
            return(false);
        }
Exemplo n.º 3
0
        public static bool TestCellStorageStack(this Cell_Storage_Collection collection, IntVec3 cell, int expectedCount)
        {
            if (collection.TryGetCellStorage(cell, out CellStorage cellStorage))
            {
                return(Assert.AreEqaul(
                           cellStorage.Count
                           , expectedCount
                           , nameof(cellStorage.Count)
                           , nameof(expectedCount)));
            }

            ReportCantFindCell(collection, cell);
            return(false);
        }
Exemplo n.º 4
0
        public static bool TestCellStorageWeight(this Cell_Storage_Collection collection, IntVec3 cell, float expectedWeight)
        {
            if (collection.TryGetCellStorage(cell, out CellStorage cellStorage))
            {
                return(Assert.AreEqaul(
                           cellStorage.TotalWeight
                           , expectedWeight
                           , nameof(cellStorage.TotalWeight)
                           , nameof(expectedWeight)));
            }

            ReportCantFindCell(collection, cell);
            return(false);
        }