444 {
446
447 if ( slot_index != -1 )
448 {
449 PluginHorticulture module_horticulture = PluginHorticulture.Cast(
GetPlugin( PluginHorticulture ) );
450 string plant_type = module_horticulture.GetPlantType( seed );
451
452 Slot slot =
m_Slots.Get( slot_index );
453 slot.SetState(eGardenSlotState.STATE_PLANTED);
454 slot.m_PlantType = plant_type;
455 slot.SetSeed(seed);
456
457 if ( !slot.NeedsWater() || slot.GetWateredState() == eWateredState.WET)
458 {
460 if (slot.GetWateredState() == eWateredState.WET && slot.NeedsWater())
461 {
462 int waterMax = slot.GetWaterMax();
463 slot.SetWater(waterMax);
464 }
465
466 seed.LockToParent();
467
469 }
470 }
471 }
PluginBase GetPlugin(typename plugin_type)
int GetSlotIndexBySelection(string selection_component)
static const float CREATE_PLANT_DELAY
ref array< ref Slot > m_Slots
void CreatePlant(Slot slot)