Thursday, March 29, 2012

PP with JC


What was planned: 
To get the deck and piles into the PTE. 
What happened: 
*(**/**°**□**°**)/︵┻**━**┻* 
*
* 
*Problems:* 
*We need to be able to use Game Actions to communicate to all the clients
what a user attempted to do. This requires that a game contain a Deck. We
ran into many problems involving how we must store a deck inside the game
without it being a game component.* 
*
* 
*Future work:* 
*We decided it would be best to create utility classes for organizing
components as a deck rather than actually having decks. This means we must
have a nice way to select multiple components on the screen and treat them
as a deck. This means, we will probably want to write some kind of drag /
drop bounding box to select multiple components at the same time and treat
them similar to the way Jan has been doing the piles. We started work on
this but ran into a bunch of problems... we must investigate how to do this
efficiently.* 
*
* 
*FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF....* 
*
* 
*Joe and Jan* 

Tuesday, March 27, 2012

The Deck

I finished working on the deck today, however I only consider it to be an alpha version of how things should work.

You can drop stuff into it, and a menu pops up asking you to input wether to place at top, bottom, or at a specified index (a window shows up and is modal).

You can double click to get the options for the deck (peek/take/shuffle) and a "restore" function, which for now just sets the display to PeekTop (or a blank square) if the deck is empty.

I still have to revise the code and make it cleaner, and figure out why DeckCanvas implements Deck<GameComponent> and use that, instead of calling basicDeck.METHOD.

Also, I had a vision in the shower today to make the Peek options bring up a new window, which will get rid of the "restore" option. However, this would require that I create a new canvas with the same game component, since GWT doesn't like having 2 canvases with the same child :(

But I'll work on that tonight and mess around with it for a bit, and see if that's how I like it.

I also want to abstract a bunch of stuff within DeckCanvas so the file isn't 500 lines long...

SO I gotta refactor(refactor(refactor(code)));

PP with BK

What was planned:
To get the "logout" functionality when a user closes the browser or the tab

What happened:
We created a CriticalCloseHook, which is to be added to the hooks that will be run when a user hits the X button in the Comm window. However, we forgot that we were sending stuff through the network, (and we're not allowed to send a hook like that) so everything DIED :( and complained.

We have the basic backend of what should happen when a user logs out, and the code to send a message to the room so that users get notified a user has left.

Problems:
Besides everything dying because we put it in the wrong place? Nothing else.

What's next:
Put it in the right place, so that it doesn't cause everything to die and test it!

Friday, March 23, 2012

PP & SP

What was planned:

To get the Identifiable interface integrated into ClientData

What happened:
We got it to work. And we had to change a bunch of tests which relied on
getting the ID before a ClientData service was created, which was a major pain in the ass, but it works now.

We also started working on deck canvas aswell, which hasn't been finished.

Problems:
having to fix EVERY class that used ID, which was a hazzle. but none besides that.
We also used the @BeforeClass tag, which Stephen had never seen.

What's next:
Finish deck canvas!

Thursday, March 22, 2012

PP With JC

What was planned:
Working on the Deck / Piles

What Happened:
We got rid of the Pile interface and implementation, since we figured a pile was just a deck that didn't care about the ordered part. We implemented the deck interface, which has a bunch of the List<T> methods. It also has a shuffle.

Problems:
None

Next:
To make it into a component, or component definition. We're going to use a BasicDeckComponent which will have an underlying BasicDeck and who's Actions will return another Component

Working on Designers / Wizards

During our meeting on wednesday, I agreed that I would design some
easy wizards for creating components.

I got carried away when I was first designing the Deck Wizard,

I kept on asking myself
"Wouldn't it be cool if I could just drag the cards here instead of clicking a button"

"wouldn't it be cool if I could drag the cards and move em around"

And what came out of that was a really cool Deck/Pile designer. With some areas that are customizable (where you place them).

Since I had gone down that path, I made more "wizards" like that.

So far, I've done Deck/Pile. Board, Card.

Given that I'm already in that spirit, I will do the remaining wizards, with Figures, Tokens, Randomized and the Miscellaneous ones.

They will become designers however.

I shall revamp my wizards to be more like eclipses, where you have fields
and you browse stuff. It'll be kind of like the NewClass wizard, where you can add interfaces and look at those.

Thursday, March 15, 2012

RB Controller / Model

Yesterday and Today I worked on finishing the RecycleBin controller and model,
as well as the Recyclable interface.

I tested them and they work!

I also worked on RecycleBinService (for our LocalService pattern) and tested it, and it works functionally too..

Today, I tried making TTSGrid auto-update, I'm gonna use observer and observable,
but there's something missing so I'll ask Joe about it tonight, so I can connect them once and for all.

In addition, I'll be working on the RecycleBin window, and allowing it to display in 2 forms.

I will probably have to modify the RecyclableInterface to include the Type of object that the Recyclable is, so I can cast it and extract information from it...

Should have thought of that earlier.

Tuesday, March 13, 2012

Finalizing TTSGrid

I finally finished TTSGrid

I went with my gut, and made the expandable detail field be an easy method.

I was having a bunch of struggle trying to get the detailField to draw,
and was trying to do something ugly like casting, which is what I ended doing :(

There are two
getAsExpandableListGridDetailField methods,
one sets the detailField as Text
and the other as a Canvas.

The canvas one does Casting to a canvas,
and the magic under the hood is

Canvas c = (Canvas) record.getAttributeAsObject("detailField");


So, "detailField" is a reserved special Attribute, that should only be used as
the key for D getDescription.

It was a hard battle, and it's got ugly scars,
but it draws an image automagically. For that matter, it would draw anything
that you store in a canvas.


I'm also still trying to design the Recycle bin

and I'm trying to make it work as perfectly and intuitive as possible.

But for now, I have a Recyclable interface, which is the type of object that
will live in the model in a set. I was also thinking, that to unrecycle things,
I need to know wether they are CompositeImageDefinitions or GameComponentDefinitions or game components... which means there will have to be some sort of map that knows where the objects came from... I'll have to discuss this with the crew.

Sunday, March 11, 2012

TTSGrid

Today, I worked on the TTSGrid.

They are generalized ListGrid, smart-gwt. This class is used to make building a grid easier and less nasty than having to implement all different kinds of ListGridField and ListGridRecord.

They take a TTSRecord<D>.
Param <D> is any object, so we can display an image or text,
when the grid has been made to expand as a drop down.

These TTSRecords have a map of Attributes to Values.

Attributes is a special class, with 2 strings.

the first string, is a special NO-WHITESPACE key needed for the ListGridRecord's
own internal workings. The second, is the "column name" for that Key.

TTSRecords add Attributes and map them to a value.

When it comes time to displaying the info, the underlying ListGridRecord()
is populated by

setAttribute(attributeName, TTSRecord.getAttributeValue(attributeName)).


TTSGrid has a getAsListRecord(), method
which returns a
ListGrid
with the fields and records already set.

For now, they are only expandable if we do some outside magic (requires making a new ListGrid and overriding stuff).

I might make a default getAsExpandableListRecord(),
which sets the detailField upon expansion to be the param D.

It seems only reasonable to have this feature...


Thursday, March 8, 2012

Pair Programming with Joe

What we planned:
To generalize the views, so they could be displayed in different ways.

What happened:
We played around with ListGrid for about 45 minutes. Joe had never played with them, so we took the time to make a pseudo spike and get familiarized with them. About 45 minutes in, we decided to make a set of interfaces so that people can make their own listgrid with their own desired Attributes.

Problems:
None, except that ListGrid requires a bunch of classes, like GridRecord and it is a mess, but besides that, nothing else.

What's next:
Finish the interfaces and implementations of them.


Also, Joe mentioned that neither him nor I correctly use the shift key. So now I'm all self-conscious when I try to capitalize to use the correct shift key, for the opposite side of the hand i'm going to type with. It's quite hard.

Pair Programming With BKEY

What was planned:
Resting

What happened:

We were still on rest mode, but we wanted to start on the chat. We started by looking at how the PTE worked and designed our system to also have an MVC of it's own.

Problems:

Getting the view to look the way we liked it, it was pretty hard and I guess brady still has trouble getting it to look just how we imagined it.

What's next:

Finish teh viez0rs zo it lookcs kul.


Sunday, March 4, 2012

‎(/°□°)/︵ (,,)>

<('') ︵/ (°□°/)


Flipping Penguins!


Yesterday, Brady and I worked on the PTE for a little bit. We tried abstracting it so the MVC would work correctly. Sadly, he had to leave early so I kept on working on it, because, we all know, programming is addictive. 


At the end of the night, about 1 AM, I finally got penguins to perform their action. For now, all they do is FLIP!


But, I was so happy I had to make emoticons to express my penguin flipping abilities :
‎(/°□°)/︵ (,,)>
<('') ︵/ (°□°/)


I had to write my own FlipperAction, in order to make them infinitely flip. The other FLIP action only works once,
which makes me think we're going to have to make a special StateSwitcherCircular action or something, to allow an object to go
from one state, to another, in an ordered list. Wouldn't be too hard.


What's in store for today:


Fixing all the //XXX Hacky as F parts that I placed yesterday in ordrer to 
get things working. 
Fixing the MVC structure. 
Hooking it up to the network. 
Loading a new game and having everything update correctly.




My first step is going to be adding a "Board" object to the already world renowned Penguin Flipper's game. The board shouldn't be Moveable. Which means I might have to change some code around, but that's okay, it won't be too much.


Afterwards, I'm going to make another TestGame, and test that the setGame(Game ) actually clears the canvas, or makes a  new one with the appropriate components. 


Afterwords, I'll fix the MVC structure... and Hook it up to the network. 





Saturday, March 3, 2012

Programming Alone Fri/Saturday

On the GETERDONE spirit, I decided to work a little bit on the PlayTestEnvironment. Lasnight, I wasn't sure what Brady was touching or not, so I decided to not mess too much with it.

My main focus, was to get SOMETHING showing up within the window.

I had to create a MockGame with some MockGameComponents, which all had MockCID,
which are mock composite image definitions.

It was kinda late, so I stopped at about 11 pm cuz I couldn't think and I was getting a bunch of null pointer exceptions.

This morning, I finally got it to draw the 2 penguins and to make them move! Which was a huge success.

I was unsure of how Brady was working with the controller and model, so in the spirit to not ruin that, just in case he was touching them, I decided to make the play test environment cooler.

I added an AboutDeveloper button, basically, you click it and it will pop up a new window which tells you some info about the developer. It shows what they wrote about themselves in the description.

I saw this cool withdrawable item thing within a Grid list. So, I decided to make one. Basically, all you see is the name field for each of the developer's game, and you can hit an arrow to expand and see that particular game's description. I also left it open ended, so you can later rate it based on PowerPenguins (highest 5, lowest 0. but for now, the rating for each game isn't stored anywhere.

IT took me a while to do that however, making the form was pretty different. You basically have to create something extending ListGridRecord, so you can add it to ListGrid. These records have special methods, which work in the form of associating a particular string, to that string's data. So, "name" would be associated with "Checker Penguin" for an instance in the record, yet "name" is also associated with "Risk" in another record instance. I pictured it in my mind, as a sort of mapping of sorts.

In addition, the Record requires a method getFieldAsValue(String field). Which, given "name" will return that particular record's real game.

In retrospect, GWT examples are COOl, but they are poorly commented as to how things work within each other... which would be appreciated; but based on the code, I was able to figure out how to make it work.

All in all, this guy looks pretty cool, IMO.

I also worked on a PenguinIcon for the RuleBook.

Thursday, March 1, 2012

Pair Programming With Joe!

Our goal:

To finish the CompositeImageSelector within the Designer.

What happened:
Joe had worked on most of it, I just did a small portion to make it all look nice and have a tool tip and display the information. I also offered some cool ideas, like the image knowing it's default size upon uploading, and then the resizing within the upload process to take effect as the user is selecting the dimensions of the image.

In addition, we went ahead with the Desktop looking idea, and Joe and I worked on making some new penguin icons. We made it so that now you have to double click on a penguin to launch an application.

We also made the penguins' color fade out, when the particular application is open, and go back to normal when it is closed. The penguins are also movable (like in a desktop) and can be placed anywhere.

Problems:
THE FREAKING CLOSE FUNCTION TOOK US LIKE AN HOUR TO FIGURE OUT!

(/°□°)/︵ ┻━┻
(/°□°)/︵ ┻━┻
(/°□°)/︵ ┻━┻

That's enough to describe how frustrating that was. We tried so many things, we ended up implementing ObservableWindow and overriding the hide method and show methods.





What comes next:
To make a cool dock where you can dock the penguins to any of the 4 sides (which would be way cool).