Main Page
·
Modules
·
All Classes
·
Class Hierarchy
mindaibo
src
behaviors
lying
MAExerciseStartTalk.cpp
1
/*
2
* This file is part of the AiBO+ project
3
*
4
* Copyright (C) 2005-2016 Csaba Kertész (csaba.kertesz@gmail.com)
5
*
6
* AiBO+ is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* AiBO+ is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
19
*
20
*/
21
22
#include "MAExerciseStartTalk.hpp"
23
24
#include "core/MARandomness.hpp"
25
#include "MABodyExercise.hpp"
26
27
MAExerciseStartTalk::MAExerciseStartTalk() :
MABehavior
(
MCGetClassName
(this))
28
{
29
}
30
31
32
MABehavior::StimulusLevelType
MAExerciseStartTalk::GetCurrentStimulus
()
33
{
34
return
MABehavior::OverStimulated
;
35
}
36
37
38
void
MAExerciseStartTalk::ActivatingActions
()
39
{
40
MA_RANDOM_POINT_1
(FirstSentence, 1, 2);
41
42
if
(FirstSentence == 1)
43
PlaySound
(
"gonefeet1"
);
44
45
MA_RANDOM_POINT_1
(SecondSentence, 1, 5);
46
47
if
(SecondSentence == 1)
48
PlaySound
(
"gonefeet2"
);
49
if
(SecondSentence == 2)
50
PlaySound
(
"gonefeet3"
);
51
if
(SecondSentence == 3)
52
PlaySound
(
"gonefeet4"
);
53
}
54
55
56
void
MAExerciseStartTalk::FinishingActions
()
57
{
58
MABEHAVIOR_CREATE
(
MABodyExercise
,
GetMaster
());
59
}
MA_RANDOM_POINT_1
#define MA_RANDOM_POINT_1(_variable_name, _min, _max)
Set a random point with one value.
Definition:
MARandomness.hpp:35
MABehavior
Behavior base class.
Definition:
MABehavior.hpp:157
MABehavior::PlaySound
int PlaySound(const std::string &name)
Play a sound and register the playback.
Definition:
MABehavior.cpp:823
MABehavior::StimulusLevelType
StimulusLevelType
Definition:
MABehavior.hpp:170
MABEHAVIOR_CREATE
#define MABEHAVIOR_CREATE(_behavior, _master,...)
Create behaviors with custom constructor safely.
Definition:
MABehavior.hpp:43
MCGetClassName
std::string MCGetClassName(T *instance=nullptr, const std::string &name_suffix="")
Get a class name.
Definition:
MCDefs.hpp:627
MABehavior::GetMaster
MABehavior * GetMaster()
Get the master behavior.
Definition:
MABehavior.cpp:486
MABodyExercise
Do a body exercise while lying.
Definition:
MABodyExercise.hpp:34
MAExerciseStartTalk::ActivatingActions
virtual void ActivatingActions() override
Perform actions when the behavior is being activated.
Definition:
MAExerciseStartTalk.cpp:38
MAExerciseStartTalk::FinishingActions
virtual void FinishingActions() override
Perform actions when the behavior is being finished.
Definition:
MAExerciseStartTalk.cpp:56
MAExerciseStartTalk::GetCurrentStimulus
virtual MABehavior::StimulusLevelType GetCurrentStimulus() override
Get the current behavior stimulus.
Definition:
MAExerciseStartTalk.cpp:32
MABehavior::OverStimulated
Definition:
MABehavior.hpp:174
Generated by
1.8.11