mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-09-01 11:53:03 +02:00
easier to understand
This commit is contained in:
parent
4804e91011
commit
78843c9a26
2 changed files with 13 additions and 2 deletions
|
@ -16,7 +16,6 @@ Object.keys(tasks).forEach(taskName => {
|
|||
return;
|
||||
}
|
||||
|
||||
// Extract category from task name
|
||||
const category = taskName.split('_variant_')[0];
|
||||
counts[category] = (counts[category] || 0) + 1;
|
||||
});
|
||||
|
|
|
@ -2,11 +2,23 @@ import fs from 'fs';
|
|||
import {proceduralGeneration} from "../../src/agent/construction_tasks.js";
|
||||
|
||||
function createInitialInventory(blueprint, agents) {
|
||||
/*
|
||||
params:
|
||||
- blueprint object
|
||||
- number of agents (for inventory initialization)
|
||||
|
||||
logic of the function:
|
||||
- loop matrix
|
||||
- every time a new material is hit, put it in a different agents inventory
|
||||
-
|
||||
*/
|
||||
|
||||
|
||||
const inventories = {};
|
||||
const materialCounts = {};
|
||||
let currentAgent = 0;
|
||||
|
||||
// Initialize agent inventories
|
||||
// Initialize inventories
|
||||
for (let i = 0; i < agents; i++) {
|
||||
inventories[i] = {};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue