#include "GuiAnimation.h"
namespace
{
namespace
{
namespace
{
using
namespace
collections
;
using
namespace
reflection
::
description
;
class
:
public
,
public
virtual
{
protected
:
;
;
bool
=
false
;
public
:
()
{
}
()
{
}
void
()
override
{
::
();
=
0
;
=
true
;
}
void
()
override
{
=
();
=
false
;
}
void
()
override
{
::
();
=
true
;
}
()
{
if
(
)
{
return
+ (
::
().
-
.
);
}
else
{
return
;
}
}
};
class
:
public
{
protected
:
=
0
;
=
0
;
<
void
(
)>
;
public
:
(
const
<
void
(
)>&
,
)
:run(
)
, length(
)
{
}
()
{
}
void
()
override
{
=
();
if
(
<
&&
)
{
);
}
}
bool
()
override
{
return
>=
;
}
};
class
:
public
{
protected
:
<
void
(
)>
;
public
:
(
const
<
void
(
)>&
)
:run(
)
{
}
()
{
}
void
()
override
{
if
(
)
{
());
}
}
bool
()
override
{
return
false
;
}
};
<
>
::
(
const
<
void
(
)>&
,
)
{
return
new
(
,
);
}
<
>
::
(
const
<
void
(
)>&
)
{
return
new
(
);
}
class
:
public
,
public
virtual
::
{
protected
:
::
;
<
>
;
<
>
;
= -
1
;
<
,
<
>>
;
public
:
(
const
::
&
)
:creator(
)
{
}
()
{
}
void
(
<
>
)
override
{
CHECK_ERROR(!waitingAnimation && waitingGroup == -1, L"GuiCoroutineAnimation::OnPlayAndWait(Ptr<IGuiAnimation>)#Cannot be called when an animation or a group has already been waiting for.");
do
{
if
(!(!
&&
== -
1
))
throw
(
L"GuiCoroutineAnimation::OnPlayAndWait(Ptr<IGuiAnimation>)#Cannot be called when an animation or a group has already been waiting for."
);}
while
(
0
);
;
();
}
void
(
<
>
,
)
override
{
.
(
,
);
();
}
void
(
)
override
{
CHECK_ERROR(!waitingAnimation && waitingGroup == -1, L"GuiCoroutineAnimation::OnWaitForGroup(vint)#Cannot be called when an animation or a group has already been waiting for.");
do
{
if
(!(!
&&
== -
1
))
throw
(
L"GuiCoroutineAnimation::OnWaitForGroup(vint)#Cannot be called when an animation or a group has already been waiting for."
);}
while
(
0
);
if
(
.
().
(
))
{
=
;
}
}
void
()
override
{
CHECK_ERROR(!coroutine, L"GuiCoroutineAnimation::Start()#Cannot be called more than once.");
do
{
if
(!(!
))
throw
(
L"GuiCoroutineAnimation::Start()#Cannot be called more than once."
);}
while
(
0
);
this
);
}
void
()
override
{
if
(
)
{
();
}
for
(
=
0
;
i
<
.
();
i
++)
{
FOREACH(Ptr<IGuiAnimation>, animation, groupAnimations.GetByIndex(i))
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
.
(
i
));
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
animation
);)
{
animation
();
}
}
}
void
()
override
{
if
(
)
{
();
}
for
(
=
0
;
i
<
.
();
i
++)
{
FOREACH(Ptr<IGuiAnimation>, animation, groupAnimations.GetByIndex(i))
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
.
(
i
));
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
animation
);)
{
animation
();
}
}
}
void
()
override
{
CHECK_ERROR(coroutine, L"GuiCoroutineAnimation::Run()#Cannot be called before calling Start.");
do
{
if
(!(
))
throw
(
L"GuiCoroutineAnimation::Run()#Cannot be called before calling Start."
);}
while
(
0
);
if
(
)
{
();
if
(
())
{
nullptr
;
}
}
for
(
=
.
() -
1
;
i
>=
0
;
i
--)
{
auto
&
=
.
(
i
);
for
(
=
animations
.
() -
1
;
j
>=
0
;
j
--)
{
auto
=
animations
j
];
animation
();
if
(
animation
())
{
.
(
i
,
animation
.
());
}
}
}
if
(
!= -
1
&& !
.
().
(
))
{
= -
1
;
}
if
(
() ==
::
)
{
if
(
||
!= -
1
)
{
return
;
}
(
true
,
nullptr
);
}
}
bool
()
override
{
if
(!
)
return
false
;
if
(
() !=
::
)
return
false
;
if
(
||
.
() >
0
)
return
false
;
return
true
;
}
};
void
::
(
*
,
)
{
return
(
,
::
({},
));
}
void
::
(
*
,
<
>
)
{
->
(
);
}
void
::
(
*
,
<
>
,
)
{
->
(
,
);
}
void
::
(
*
,
)
{
->
(
);
}
void
::
(
*
)
{
}
<
>
::
(
const
&
)
{
return
new
(
);
}
}
}
}