Add university and fire station civic buildings plus 7 new store types, each with facade and luminous blade signs. Extend landmark material colors and sign accents. Fix ATC dispatch to reject prompt-echoing AI responses via heuristic guard. Add CityPlacesTest for collision and roadway avoidance, and extend AirportTest and SignLabelsTest.
129 lines
4.7 KiB
PHP
Executable File
129 lines
4.7 KiB
PHP
Executable File
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\AiAgent;
|
|
use App\Models\Store;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
/**
|
|
* Seeds a starter set of AI agents and stores for the virtual city.
|
|
*
|
|
* Provides the Mayor, a few shopkeepers and pedestrian agents together
|
|
* with representative buildings so that the 3D scene has content to
|
|
* render on first load.
|
|
*/
|
|
class CityContentSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Seed AI agents and stores.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$shopkeeper = User::where('email', 'user@sistema.net')->first();
|
|
|
|
// --- Mayor: coordinates the city at a macro level -----------------
|
|
$mayor = AiAgent::updateOrCreate(
|
|
['name' => 'Prefeito Augusto'],
|
|
[
|
|
'type' => 'mayor',
|
|
'model' => config('ai.default_model'),
|
|
'system_prompt' => 'Você é o Prefeito da cidade virtual City10. Tome decisões macro sobre infraestrutura, tráfego e qualidade de vida dos cidadãos.',
|
|
'current_goal' => 'Manter a cidade segura e próspera',
|
|
'status' => 'active',
|
|
'pos_x' => 0, 'pos_y' => 0, 'pos_z' => 0,
|
|
],
|
|
);
|
|
|
|
// --- Shopkeepers --------------------------------------------------
|
|
$baker = AiAgent::updateOrCreate(
|
|
['name' => 'Seu João — Padaria Central'],
|
|
[
|
|
'type' => 'shopkeeper',
|
|
'model' => config('ai.default_model'),
|
|
'system_prompt' => 'Você é o dono da Padaria Central. Gerencie estoque, preços e atendimento com simpatia.',
|
|
'current_goal' => 'Aumentar as vendas da manhã',
|
|
'status' => 'active',
|
|
'pos_x' => 12, 'pos_y' => 0, 'pos_z' => -8,
|
|
],
|
|
);
|
|
|
|
// --- Pedestrians --------------------------------------------------
|
|
AiAgent::updateOrCreate(
|
|
['name' => 'Nara'],
|
|
[
|
|
'type' => 'pedestrian',
|
|
'model' => config('ai.default_model'),
|
|
'system_prompt' => 'Você é a Nara, uma pedestre amigável. Converse brevemente com quem se aproximar.',
|
|
'current_goal' => 'Caminhar até a praça',
|
|
'status' => 'active',
|
|
'pos_x' => 20, 'pos_y' => 0, 'pos_z' => 10,
|
|
],
|
|
);
|
|
|
|
AiAgent::updateOrCreate(
|
|
['name' => 'Wilson'],
|
|
[
|
|
'type' => 'pedestrian',
|
|
'model' => config('ai.default_model'),
|
|
'system_prompt' => 'Você é o Wilson, um pedestre que trabalha na loja de material de construção.',
|
|
'current_goal' => 'Voltar para casa',
|
|
'status' => 'active',
|
|
'pos_x' => 6, 'pos_y' => 0, 'pos_z' => 4,
|
|
],
|
|
);
|
|
|
|
AiAgent::updateOrCreate(
|
|
['name' => 'Amanda'],
|
|
[
|
|
'type' => 'pedestrian',
|
|
'model' => config('ai.default_model'),
|
|
'system_prompt' => 'Você é a Amanda, criadora de conteúdo. Gosta de conversar sobre arte e moda.',
|
|
'current_goal' => 'Fotografe a praça para o feed',
|
|
'status' => 'active',
|
|
'pos_x' => 30, 'pos_y' => 0, 'pos_z' => 6,
|
|
],
|
|
);
|
|
|
|
// --- Stores -------------------------------------------------------
|
|
Store::updateOrCreate(
|
|
['name' => 'Padaria Central'],
|
|
[
|
|
'description' => 'Pães frescos e cafés desde 1998.',
|
|
'type' => 'bakery',
|
|
'owner_id' => $shopkeeper?->id,
|
|
'agent_id' => $baker->id,
|
|
'pos_x' => 12, 'pos_y' => 0, 'pos_z' => -12,
|
|
'width' => 8, 'height' => 6, 'depth' => 8,
|
|
'is_open' => true,
|
|
],
|
|
);
|
|
|
|
Store::updateOrCreate(
|
|
['name' => 'Mercado Municipal'],
|
|
[
|
|
'description' => 'Produtos frescos e itens do dia a dia.',
|
|
'type' => 'market',
|
|
'owner_id' => $shopkeeper?->id,
|
|
'agent_id' => $mayor->id,
|
|
'pos_x' => -18, 'pos_y' => 0, 'pos_z' => 14,
|
|
'width' => 14, 'height' => 8, 'depth' => 12,
|
|
'is_open' => true,
|
|
],
|
|
);
|
|
|
|
Store::updateOrCreate(
|
|
['name' => 'Loja de Materiais da Esquina'],
|
|
[
|
|
'description' => 'Material de construção e ferramentas.',
|
|
'type' => 'hardware',
|
|
'owner_id' => $shopkeeper?->id,
|
|
'pos_x' => 11, 'pos_y' => 0, 'pos_z' => 10,
|
|
'width' => 10, 'height' => 7, 'depth' => 10,
|
|
'is_open' => true,
|
|
],
|
|
);
|
|
}
|
|
}
|