Debian Codegraph @

src/elbowdownleft.cpp

raw symbols SCIP
1 /***************************************************************************
2 elbowdownleft.cpp - description
3 -------------------
4 begin : Thu Aug 17 2000
5 copyright : (C) 2000 by Waldemar Baraldi
6 email : [email protected]
7 ***************************************************************************/
8
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18 #include "elbowdownleft.h"cxx . . $ `<file>/src/elbowdownleft.h`/
19 #include "pointerelbowdownleft.h"cxx . . $ `<file>/src/pointerelbowdownleft.h`/
20
21 ElbowDownLeftcxx . . $ ElbowDownLeft#::ElbowDownLeftcxx . . $ ElbowDownLeft#ElbowDownLeft(49f6e7a06ebc5aa8).():Pipecxx . . $ Pipe#(){
22 pcxx . . $ Pipe#p.=new PointerElbowDownLeftcxx . . $ PointerElbowDownLeft#();
23 }
24
25 ElbowDownLeftcxx . . $ ElbowDownLeft#::~cxx . . $ ElbowDownLeft#`~ElbowDownLeft`(ced63f7c635d850d).ElbowDownLeftcxx . . $ ElbowDownLeft#(){
26 delete pcxx . . $ Pipe#p.;
27 }
28
29 bool ElbowDownLeftcxx . . $ ElbowDownLeft#::hasConnectioncxx . . $ ElbowDownLeft#hasConnection(eebf787ddd78fff5).(CardinalPointcxx . . $ CardinalPoint# con){
30 return ((con==Westcxx . . $ West.) || (con==Southcxx . . $ South.));
31 }
32
33 CardinalPointcxx . . $ CardinalPoint# ElbowDownLeftcxx . . $ ElbowDownLeft#::getOutputcxx . . $ ElbowDownLeft#getOutput(fbd438076a101a96).(CardinalPointcxx . . $ CardinalPoint# input){
34 if (input==rocxx . . $ Pipe#ro.) return Voidcxx . . $ Void.;
35 switch (input){
36 case Southcxx . . $ South.: return Westcxx . . $ West.;
37 case Westcxx . . $ West.:return Southcxx . . $ South.;
38 default:return Voidcxx . . $ Void.;
39 }
40 }
41
42 void ElbowDownLeftcxx . . $ ElbowDownLeft#::restrictAsOutputcxx . . $ ElbowDownLeft#restrictAsOutput(c47d336573415769).(CardinalPointcxx . . $ CardinalPoint# con){
43 if (con==Southcxx . . $ South. || con==Westcxx . . $ West.) rocxx . . $ Pipe#ro.=con;
44 }
45
46 bool ElbowDownLeftcxx . . $ ElbowDownLeft#::isRestrictedAsOutputcxx . . $ ElbowDownLeft#isRestrictedAsOutput(eebf787ddd78fff5).(CardinalPointcxx . . $ CardinalPoint# con){
47 return (rocxx . . $ Pipe#ro.==con);
48 }
49
50 void ElbowDownLeftcxx . . $ ElbowDownLeft#::incFullLevelcxx . . $ ElbowDownLeft#incFullLevel(5c0eb7cda63e3855).(CardinalPointcxx . . $ CardinalPoint# input,unsigned int amount){
51 if ((input==Southcxx . . $ South. || input==Westcxx . . $ West.) && rocxx . . $ Pipe#ro.!=input)
52 if ((used_inputcxx . . $ Pipe#used_input.==Voidcxx . . $ Void.) || (used_inputcxx . . $ Pipe#used_input.==input)){
53 full_levelcxx . . $ Pipe#full_level.+=amount;
54 used_inputcxx . . $ Pipe#used_input.=input;
55 }
56 }
57
58 int ElbowDownLeftcxx . . $ ElbowDownLeft#::getFullLevelcxx . . $ ElbowDownLeft#getFullLevel(bad1fd3a9fbe27b6).(CardinalPointcxx . . $ CardinalPoint# input){
59 if (input==used_inputcxx . . $ Pipe#used_input.) return full_levelcxx . . $ Pipe#full_level.;
60 return 0;
61 }
62
63 Pointercxx . . $ Pointer# * ElbowDownLeftcxx . . $ ElbowDownLeft#::getPointercxx . . $ ElbowDownLeft#getPointer(519f973faac47112).(){
64 return pcxx . . $ Pipe#p.;
65 }
66
67 void ElbowDownLeftcxx . . $ ElbowDownLeft#::paintcxx . . $ ElbowDownLeft#paint(dec28a01b93bce57).(VideoManagercxx . . $ VideoManager# * vm){
68 Imagecxx . . $ Image# * ima;
69 if (fixedcxx . . $ Pipe#fixed.)
70 ima=(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).())->getImagecxx . . $ ImageManager#getImage(3ac71a4852078d03).(new Strcxx . . $ Str#("elbow_swb.png"));
71 else
72 ima=(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).())->getImagecxx . . $ ImageManager#getImage(3ac71a4852078d03).(new Strcxx . . $ Str#("elbow_sw.png"));
73 vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(ima, xcxx . . $ Canvas#x., ycxx . . $ Canvas#y.);
74
75 if (rocxx . . $ Pipe#ro.!=Voidcxx . . $ Void.) paintRestrictioncxx . . $ Pipe#paintRestriction(79d4807f4eb46d42).(vm,rocxx . . $ Pipe#ro.);
76 if (full_levelcxx . . $ Pipe#full_level.>0){
77 Imagecxx . . $ Image# * aux=(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).())->getImagecxx . . $ ImageManager#getImage(3ac71a4852078d03).(new Strcxx . . $ Str#("flow.png"));
78 float fwidth=(float)PipeWidthcxx . . $ PipeWidth./2;
79 float fheight=(float)PipeHeightcxx . . $ PipeHeight./2;
80 float nov=PIcxx . . $ `src/object.h:17:9`!/2;
81 vm->setClippingcxx . . $ Graphic#setClipping(748afa4755bc9595).(xcxx . . $ Canvas#x., ycxx . . $ Canvas#y., PipeWidthcxx . . $ PipeWidth., PipeHeightcxx . . $ PipeHeight.);
82 vm->enableClippingcxx . . $ Graphic#enableClipping(b45ddcbc8423892c).(true);
83 int xaux=xcxx . . $ Canvas#x.-aux->widthcxx . . $ Surface#width(b126dc7c1de90089).()/2;
84 int yaux=ycxx . . $ Canvas#y.+PipeHeightcxx . . $ PipeHeight.-aux->widthcxx . . $ Surface#width(b126dc7c1de90089).()/2;
85 if (used_inputcxx . . $ Pipe#used_input.==Southcxx . . $ South.){
86 for (int i=0; i<full_levelcxx . . $ Pipe#full_level.+1;i+=Grancxx . . $ Pipe#Gran.)
87 vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(aux, (int)(xaux+(float)coscxx . . $ cos(fbcf3211dfe1bfd1).((float)i/(float)fullcxx . . $ Pipe#full(b126dc7c1de90089).() * nov)*fwidth),
88 (int)(yaux-(float)sincxx . . $ sin(fbcf3211dfe1bfd1).((float)i/(float)fullcxx . . $ Pipe#full(b126dc7c1de90089).() * nov)*fheight));
89 }else{
90 for (int i=0; i<full_levelcxx . . $ Pipe#full_level.+1;i+=Grancxx . . $ Pipe#Gran.)
91 vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(aux, (int)(xaux+(float)coscxx . . $ cos(fbcf3211dfe1bfd1).((float)(fullcxx . . $ Pipe#full(b126dc7c1de90089).()-i)/(float)fullcxx . . $ Pipe#full(b126dc7c1de90089).() * nov)*fwidth),
92 (int)(yaux-(float)sincxx . . $ sin(fbcf3211dfe1bfd1).((float)(fullcxx . . $ Pipe#full(b126dc7c1de90089).()-i)/(float)fullcxx . . $ Pipe#full(b126dc7c1de90089).() * nov)*fheight));
93 }
94 vm->enableClippingcxx . . $ Graphic#enableClipping(b45ddcbc8423892c).(false);
95 }
96 if (bonuscxx . . $ Pipe#bonus.!=NormalBonuscxx . . $ NormalBonus.) paintBonuscxx . . $ Pipe#paintBonus(1e922b71c0766333).(vm, bonuscxx . . $ Pipe#bonus.);
97 }