Serious Game - Electrónica VR 1.0.0
Loading...
Searching...
No Matches
ComponentDeliverySystem Class Reference

Sistema de entrega asimétrica de componentes — VERSIÓN CORRECTA. More...

Inheritance diagram for ComponentDeliverySystem:
Inheritance graph
Collaboration diagram for ComponentDeliverySystem:
Collaboration graph

Public Member Functions

void SendResistor (float resistanceValue)
 El Técnico envía una resistencia con CUALQUIER valor. NO se valida aquí — el Explorador recibirá el componente igualmente. La validación real sucede cuando se instala en un slot.
void SendLED (bool correctPolarity=true)
 El Técnico envía un LED con la polaridad que decidió. Si se equivoca, el LED no encenderá al instalarse.
void SendCapacitor (bool correctPolarity=true)
 El Técnico envía un capacitor con la polaridad elegida.
void SendArduinoPin (int pinNumber)
 El Técnico envía un pin Arduino.
void OnExplorerInstalled (ComponentSlot slot)
 Llamado por ComponentSlot cuando el Explorador instala un componente.
bool HasPendingDelivery ()
void CancelDelivery ()
void PrepareForInstall (ComponentType tipo, float valor)
 Llamado por ExplorerComponentReceiver cuando llega un componente desde la red. Prepara el estado local sin spawnear (el objeto ya fue instanciado por el Receiver).

Public Attributes

GameManager gameManager
Transform puntoDeEntrega
GameObject resistorPrefab
GameObject ledPrefab
GameObject capacitorPrefab
GameObject arduinoPinPrefab

Events

static Action< ComponentType, float > OnComponentSent
static Action< bool > OnComponentInstalled
static Action< bool > OnRepairValidated
static Action< string > OnDeliveryError

Private Member Functions

void OnEnable ()
void OnDisable ()
void OnLevelLoaded (LevelType _)
void SpawnInDeliveryTray (GameObject prefab, float value)
void ConfigureSpawnedComponent (GameObject comp, float value)
 Aplica el valor/polaridad al componente físico spawneado. Así el componente visible en la bandeja REFLEJA lo que envió el Técnico.
bool ValidateValueForRepair ()
void ApplyRepairToCircuit ()
void ApplyIncorrectValueToCircuit ()
 Aplica el valor INCORRECTO al circuito para que el Explorador vea el efecto visual — LED sigue rojo, humo, sobrecarga, etc. El circuito NO se marca como reparado.
ComponentSlotType GetSlotTypeFor (ComponentType type)
void ResetDeliveryState ()
void CancelPendingDelivery ()

Private Attributes

ComponentType _pendingType = ComponentType.None
float _pendingValue = 0f
bool _waitingForInstall = false
GameObject _spawnedComponent

Detailed Description

Sistema de entrega asimétrica de componentes — VERSIÓN CORRECTA.

DISEÑO CLAVE (estilo Keep Talking and Nobody Explodes):

  • El Técnico SIEMPRE envía lo que seleccionó, sin validación previa
  • El componente físico SIEMPRE aparece en la bandeja del Explorador
  • El Explorador SIEMPRE puede instalarlo
  • La validación ocurre al aplicar al circuito:
    • Valor correcto → circuito se repara, LED cambia a verde
    • Valor incorrecto → circuito sigue dañado o empeora
  • Los jugadores deben colaborar para diagnosticar qué salió mal

Esto preserva el gameplay asimétrico real: el Técnico puede equivocarse, el Explorador ve las consecuencias, y entre los dos deben resolverlo.

Member Function Documentation

◆ ApplyIncorrectValueToCircuit()

void ComponentDeliverySystem.ApplyIncorrectValueToCircuit ( )
private

Aplica el valor INCORRECTO al circuito para que el Explorador vea el efecto visual — LED sigue rojo, humo, sobrecarga, etc. El circuito NO se marca como reparado.

◆ ApplyRepairToCircuit()

void ComponentDeliverySystem.ApplyRepairToCircuit ( )
private

◆ CancelDelivery()

void ComponentDeliverySystem.CancelDelivery ( )

◆ CancelPendingDelivery()

void ComponentDeliverySystem.CancelPendingDelivery ( )
private

◆ ConfigureSpawnedComponent()

void ComponentDeliverySystem.ConfigureSpawnedComponent ( GameObject comp,
float value )
private

Aplica el valor/polaridad al componente físico spawneado. Así el componente visible en la bandeja REFLEJA lo que envió el Técnico.

◆ GetSlotTypeFor()

ComponentSlotType ComponentDeliverySystem.GetSlotTypeFor ( ComponentType type)
private

◆ HasPendingDelivery()

bool ComponentDeliverySystem.HasPendingDelivery ( )

◆ OnDisable()

void ComponentDeliverySystem.OnDisable ( )
private

◆ OnEnable()

void ComponentDeliverySystem.OnEnable ( )
private

◆ OnExplorerInstalled()

void ComponentDeliverySystem.OnExplorerInstalled ( ComponentSlot slot)

Llamado por ComponentSlot cuando el Explorador instala un componente.

Hay DOS niveles de validación:

  1. Tipo de slot: ¿el componente va en el slot correcto?
  2. Valor: ¿el valor/polaridad es el que pide el reto?

◆ OnLevelLoaded()

void ComponentDeliverySystem.OnLevelLoaded ( LevelType _)
private

◆ PrepareForInstall()

void ComponentDeliverySystem.PrepareForInstall ( ComponentType tipo,
float valor )

Llamado por ExplorerComponentReceiver cuando llega un componente desde la red. Prepara el estado local sin spawnear (el objeto ya fue instanciado por el Receiver).

◆ ResetDeliveryState()

void ComponentDeliverySystem.ResetDeliveryState ( )
private

◆ SendArduinoPin()

void ComponentDeliverySystem.SendArduinoPin ( int pinNumber)

El Técnico envía un pin Arduino.

◆ SendCapacitor()

void ComponentDeliverySystem.SendCapacitor ( bool correctPolarity = true)

El Técnico envía un capacitor con la polaridad elegida.

◆ SendLED()

void ComponentDeliverySystem.SendLED ( bool correctPolarity = true)

El Técnico envía un LED con la polaridad que decidió. Si se equivoca, el LED no encenderá al instalarse.

◆ SendResistor()

void ComponentDeliverySystem.SendResistor ( float resistanceValue)

El Técnico envía una resistencia con CUALQUIER valor. NO se valida aquí — el Explorador recibirá el componente igualmente. La validación real sucede cuando se instala en un slot.

◆ SpawnInDeliveryTray()

void ComponentDeliverySystem.SpawnInDeliveryTray ( GameObject prefab,
float value )
private

◆ ValidateValueForRepair()

bool ComponentDeliverySystem.ValidateValueForRepair ( )
private

Member Data Documentation

◆ _pendingType

ComponentType ComponentDeliverySystem._pendingType = ComponentType.None
private

◆ _pendingValue

float ComponentDeliverySystem._pendingValue = 0f
private

◆ _spawnedComponent

GameObject ComponentDeliverySystem._spawnedComponent
private

◆ _waitingForInstall

bool ComponentDeliverySystem._waitingForInstall = false
private

◆ arduinoPinPrefab

GameObject ComponentDeliverySystem.arduinoPinPrefab

◆ capacitorPrefab

GameObject ComponentDeliverySystem.capacitorPrefab

◆ gameManager

GameManager ComponentDeliverySystem.gameManager

◆ ledPrefab

GameObject ComponentDeliverySystem.ledPrefab

◆ puntoDeEntrega

Transform ComponentDeliverySystem.puntoDeEntrega

◆ resistorPrefab

GameObject ComponentDeliverySystem.resistorPrefab

Event Documentation

◆ OnComponentInstalled

Action<bool> ComponentDeliverySystem.OnComponentInstalled
static

◆ OnComponentSent

Action<ComponentType, float> ComponentDeliverySystem.OnComponentSent
static

◆ OnDeliveryError

Action<string> ComponentDeliverySystem.OnDeliveryError
static

◆ OnRepairValidated

Action<bool> ComponentDeliverySystem.OnRepairValidated
static

The documentation for this class was generated from the following file: