Debian Codegraph @

src/elbowupright.cpp

raw symbols SCIP
1 /***************************************************************************
2 elbowupright.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 "elbowupright.h"cxx . . $ `<file>/src/elbowupright.h`/
19 #include "pointerelbowupright.h"cxx . . $ `<file>/src/pointerelbowupright.h`/
20
21 ElbowUpRightcxx . . $ ElbowUpRight#::ElbowUpRightcxx . . $ ElbowUpRight#ElbowUpRight(49f6e7a06ebc5aa8).():Pipecxx . . $ Pipe#(){
22 pcxx . . $ Pipe#p.=new PointerElbowUpRightcxx . . $ PointerElbowUpRight#();
23 }
24
25 ElbowUpRightcxx . . $ ElbowUpRight#::~cxx . . $ ElbowUpRight#`~ElbowUpRight`(ced63f7c635d850d).ElbowUpRightcxx . . $ ElbowUpRight#(){
26 delete pcxx . . $ Pipe#p.;
27 }
28
29 bool ElbowUpRightcxx . . $ ElbowUpRight#::hasConnectioncxx . . $ ElbowUpRight#hasConnection(eebf787ddd78fff5).(CardinalPointcxx . . $ CardinalPoint# con){
30 return ((con==Northcxx . . $ North.) || (con==Eastcxx . . $ East.));
31 }
32
33 CardinalPointcxx . . $ CardinalPoint# ElbowUpRightcxx . . $ ElbowUpRight#::getOutputcxx . . $ ElbowUpRight#getOutput(fbd438076a101a96).(CardinalPointcxx . . $ CardinalPoint# input){
34 switch (input){
35 case Northcxx . . $ North.: return Eastcxx . . $ East.;
36 case Eastcxx . . $ East.:return Northcxx . . $ North.;
37 default:return Voidcxx . . $ Void.;
38 }
39 }
40
41 void ElbowUpRightcxx . . $ ElbowUpRight#::restrictAsOutputcxx . . $ ElbowUpRight#restrictAsOutput(c47d336573415769).(CardinalPointcxx . . $ CardinalPoint# con){
42 if (con==Eastcxx . . $ East. || con==Northcxx . . $ North.) rocxx . . $ Pipe#ro.=con;
43 }
44
45 bool ElbowUpRightcxx . . $ ElbowUpRight#::isRestrictedAsOutputcxx . . $ ElbowUpRight#isRestrictedAsOutput(eebf787ddd78fff5).(CardinalPointcxx . . $ CardinalPoint# con){
46 return (con==rocxx . . $ Pipe#ro.);
47 }
48
49 void ElbowUpRightcxx . . $ ElbowUpRight#::incFullLevelcxx . . $ ElbowUpRight#incFullLevel(5c0eb7cda63e3855).(CardinalPointcxx . . $ CardinalPoint# input,unsigned int amount){
50 if ((input==Northcxx . . $ North. || input==Eastcxx . . $ East.) && input!=rocxx . . $ Pipe#ro.)
51 if ((used_inputcxx . . $ Pipe#used_input.==Voidcxx . . $ Void.) || (used_inputcxx . . $ Pipe#used_input.==input)){
52 full_levelcxx . . $ Pipe#full_level.+=amount;
53 used_inputcxx . . $ Pipe#used_input.=input;
54 }
55 }
56
57 int ElbowUpRightcxx . . $ ElbowUpRight#::getFullLevelcxx . . $ ElbowUpRight#getFullLevel(bad1fd3a9fbe27b6).(CardinalPointcxx . . $ CardinalPoint# input){
58 if (input==used_inputcxx . . $ Pipe#used_input.)
59 return full_levelcxx . . $ Pipe#full_level.;
60 return 0;
61 }
62
63 Pointercxx . . $ Pointer# * ElbowUpRightcxx . . $ ElbowUpRight#::getPointercxx . . $ ElbowUpRight#getPointer(519f973faac47112).(){
64 return pcxx . . $ Pipe#p.;
65 }
66
67 void ElbowUpRightcxx . . $ ElbowUpRight#::paintcxx . . $ ElbowUpRight#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_neb.png"));
71 else
72 ima=(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).())->getImagecxx . . $ ImageManager#getImage(3ac71a4852078d03).(new Strcxx . . $ Str#("elbow_ne.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
77 if (full_levelcxx . . $ Pipe#full_level.>0){
78 Imagecxx . . $ Image# * aux=(vm->getImageManagercxx . . $ VideoManager#getImageManager(d5fe12bbc8163445).())->getImagecxx . . $ ImageManager#getImage(3ac71a4852078d03).(new Strcxx . . $ Str#("flow.png"));
79 float fwidth=(float)PipeWidthcxx . . $ PipeWidth./2;
80 float fheight=(float)PipeHeightcxx . . $ PipeHeight./2;
81 float nov=PIcxx . . $ `src/object.h:17:9`!/2;
82 vm->setClippingcxx . . $ Graphic#setClipping(748afa4755bc9595).(xcxx . . $ Canvas#x., ycxx . . $ Canvas#y., PipeWidthcxx . . $ PipeWidth., PipeHeightcxx . . $ PipeHeight.);
83 vm->enableClippingcxx . . $ Graphic#enableClipping(b45ddcbc8423892c).(true);
84 int xaux=xcxx . . $ Canvas#x.+PipeWidthcxx . . $ PipeWidth.-aux->widthcxx . . $ Surface#width(b126dc7c1de90089).()/2;
85 int yaux=ycxx . . $ Canvas#y.-aux->widthcxx . . $ Surface#width(b126dc7c1de90089).()/2;
86 if (used_inputcxx . . $ Pipe#used_input.==Northcxx . . $ North.){
87 for (int i=0; i<full_levelcxx . . $ Pipe#full_level.+1;i+=Grancxx . . $ Pipe#Gran.)
88 vm->blitcxx . . $ VideoManager#blit(d6e51777aa68e081).(aux, (int)(xaux-(float)coscxx . . $ cos(fbcf3211dfe1bfd1).((float)i/(float)fullcxx . . $ Pipe#full(b126dc7c1de90089).() * nov)*fwidth),
89 (int)(yaux+(float)sincxx . . $ sin(fbcf3211dfe1bfd1).((float)i/(float)fullcxx . . $ Pipe#full(b126dc7c1de90089).() * nov)*fheight));
90 }else{
91 for (int i=0; i<full_levelcxx . . $ Pipe#full_level.+1;i+=Grancxx . . $ Pipe#Gran.)
92 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),
93 (int)(yaux+(float)sincxx . . $ sin(fbcf3211dfe1bfd1).((float)(fullcxx . . $ Pipe#full(b126dc7c1de90089).()-i)/(float)fullcxx . . $ Pipe#full(b126dc7c1de90089).() * nov)*fheight));
94 }
95 vm->enableClippingcxx . . $ Graphic#enableClipping(b45ddcbc8423892c).(false);
96 }
97 if (bonuscxx . . $ Pipe#bonus.!=NormalBonuscxx . . $ NormalBonus.) paintBonuscxx . . $ Pipe#paintBonus(1e922b71c0766333).(vm, bonuscxx . . $ Pipe#bonus.);
98 }
99